Skip to content

Commit ff56140

Browse files
committed
shorter headers
1 parent 70a30ae commit ff56140

File tree

149 files changed

+302
-1653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+302
-1653
lines changed

bn_error.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_ERROR_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
static const struct {
167
int code;

bn_fast_mp_invmod.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_FAST_MP_INVMOD_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* computes the modular inverse via binary extended euclidean algorithm,
167
* that is c = 1/a mod b

bn_fast_mp_montgomery_reduce.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* computes xR**-1 == x (mod N) via Montgomery Reduction
167
*

bn_fast_s_mp_mul_digs.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_FAST_S_MP_MUL_DIGS_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* Fast (comba) multiplier
167
*

bn_fast_s_mp_mul_high_digs.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* this is a modified version of fast_s_mul_digs that only produces
167
* output digits *above* digs. See the comments for fast_s_mul_digs

bn_fast_s_mp_sqr.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_FAST_S_MP_SQR_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* the jist of squaring...
167
* you do like mult except the offset of the tmpx [one that

bn_mp_2expt.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_2EXPT_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* computes a = 2**b
167
*

bn_mp_abs.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_ABS_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* b = |a|
167
*

bn_mp_add.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_ADD_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* high level addition (handles signs) */
167
int mp_add(const mp_int *a, const mp_int *b, mp_int *c)

bn_mp_add_d.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_ADD_D_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* single digit addition */
167
int mp_add_d(const mp_int *a, mp_digit b, mp_int *c)

bn_mp_addmod.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_ADDMOD_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* d = a + b (mod c) */
167
int mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)

bn_mp_and.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_AND_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* AND two ints together */
167
int mp_and(const mp_int *a, const mp_int *b, mp_int *c)

bn_mp_clamp.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CLAMP_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* trim unused digits
167
*

bn_mp_clear.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CLEAR_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* clear one (frees) */
167
void mp_clear(mp_int *a)

bn_mp_clear_multi.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CLEAR_MULTI_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
#include <stdarg.h>
167

bn_mp_cmp.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CMP_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* compare two ints (signed)*/
167
int mp_cmp(const mp_int *a, const mp_int *b)

bn_mp_cmp_d.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CMP_D_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* compare a digit */
167
int mp_cmp_d(const mp_int *a, mp_digit b)

bn_mp_cmp_mag.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CMP_MAG_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* compare maginitude of two ints (unsigned) */
167
int mp_cmp_mag(const mp_int *a, const mp_int *b)

bn_mp_cnt_lsb.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_CNT_LSB_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
static const int lnz[16] = {
167
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0

bn_mp_complement.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_COMPLEMENT_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* b = ~a */
167
int mp_complement(const mp_int *a, mp_int *b)

bn_mp_copy.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#include "tommath_private.h"
22
#ifdef BN_MP_COPY_C
3-
/* LibTomMath, multiple-precision integer library -- Tom St Denis
4-
*
5-
* LibTomMath is a library that provides multiple-precision
6-
* integer arithmetic as well as number theoretic functionality.
7-
*
8-
* The library was designed directly after the MPI library by
9-
* Michael Fromberger but has been written from scratch with
10-
* additional optimizations in place.
11-
*
12-
* SPDX-License-Identifier: Unlicense
13-
*/
3+
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
4+
/* SPDX-License-Identifier: Unlicense */
145

156
/* copy, b = a */
167
int mp_copy(const mp_int *a, mp_int *b)

0 commit comments

Comments
 (0)