Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaeckel committed Aug 29, 2017
2 parents f551dbc + 2900733 commit 5953f62
Show file tree
Hide file tree
Showing 170 changed files with 13,297 additions and 12,681 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore

/** export-subst
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ mtest.exe
*.pdf
*.out
tommath.tex
libtommath.pc

# ignore files generated by testme.sh
gcc_errors_*.txt
test_*.txt

*.bak
*.orig
*.asc
*.tar.xz
*.zip
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ compiler:
- gcc

script:
- make
- make test
- make mtest
- ./mtest/mtest 666666 | ./test > test.log
- make travis_mtest
- head -n 5 test.log
- tail -n 2 test.log
- ./testme.sh
- ./testme.sh --with-cc=gcc --with-low-mp

branches:
only:
- master
- develop
- /^release\/.*$/

notifications:
irc: "chat.freenode.net#libtom"
irc: "chat.freenode.net#libtom-notifications"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)
[![Build Status - master](https://travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath)

[![Build Status - develop](https://travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)

This is the git repository for [LibTomMath](http://www.libtom.org/), a free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C.

Expand Down
6 changes: 3 additions & 3 deletions bn_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ const char *mp_error_to_string(int code)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_fast_mp_invmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL);
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_fast_mp_montgomery_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,6 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_fast_s_mp_mul_digs.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_fast_s_mp_mul_high_digs.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_fast_s_mp_sqr.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_2expt.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ mp_2expt (mp_int * a, int b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_abs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ mp_abs (mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
12 changes: 6 additions & 6 deletions bn_mp_add_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
/* old number of used digits in c */
oldused = c->used;

/* sign always positive */
c->sign = MP_ZPOS;

/* source alias */
tmpa = a->dp;

Expand Down Expand Up @@ -96,6 +93,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
ix = 1;
}

/* sign always positive */
c->sign = MP_ZPOS;

/* now zero to oldused */
while (ix++ < oldused) {
*tmpc++ = 0;
Expand All @@ -107,6 +107,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_addmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_and.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ mp_and (mp_int * a, mp_int * b, mp_int * c)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_clamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ mp_clamp (mp_int * a)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_clear.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ mp_clear (mp_int * a)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_clear_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ void mp_clear_multi(mp_int *mp, ...)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ mp_cmp (mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_cmp_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ int mp_cmp_d(mp_int * a, mp_digit b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_cmp_mag.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ int mp_cmp_mag (mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_cnt_lsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ int mp_cnt_lsb(mp_int *a)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ mp_copy (mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_count_bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ mp_count_bits (mp_int * a)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,6 @@ LBL_Q:mp_clear (&q);

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_div_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ int mp_div_2(mp_int * a, mp_int * b)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
25 changes: 7 additions & 18 deletions bn_mp_div_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
{
mp_digit D, r, rr;
int x, res;
mp_int t;


/* if the shift count is <= 0 then we do no work */
if (b <= 0) {
Expand All @@ -32,24 +30,19 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
return res;
}

if ((res = mp_init (&t)) != MP_OKAY) {
/* copy */
if ((res = mp_copy (a, c)) != MP_OKAY) {
return res;
}
/* 'a' should not be used after here - it might be the same as d */

/* get the remainder */
if (d != NULL) {
if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) {
mp_clear (&t);
if ((res = mp_mod_2d (a, b, d)) != MP_OKAY) {
return res;
}
}

/* copy */
if ((res = mp_copy (a, c)) != MP_OKAY) {
mp_clear (&t);
return res;
}

/* shift by as many digits in the bit count */
if (b >= (int)DIGIT_BIT) {
mp_rshd (c, b / DIGIT_BIT);
Expand Down Expand Up @@ -84,14 +77,10 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
}
}
mp_clamp (c);
if (d != NULL) {
mp_exch (&t, d);
}
mp_clear (&t);
return MP_OKAY;
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_div_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_div_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_dr_is_modulus.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ int mp_dr_is_modulus(mp_int *a)

#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
6 changes: 3 additions & 3 deletions bn_mp_dr_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k)
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
Loading

0 comments on commit 5953f62

Please sign in to comment.