Commit graph

103 commits

Author SHA1 Message Date
Steffen Jaeckel
18e67e1888 Replace locking by atomic operations
`s_warray_init()` and `s_warray_free()` are not safe and MUST NOT be called
from multiple threads.

This also removes `MP_WARRAY_NUM`, since automatic initialization will not
be safe for more than one thread.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-03-27 16:25:27 +01:00
Steffen Jaeckel
bd66fccee4 add MP_SMALL_STACK_SIZE option
This adds an option to use a heap-buffer for the usually stack-based
`MP_WARRAY`-sized temporary buffers.

Per default it will reserve a single buffer, which can be modified
* at compile-time via the `MP_WARRAY_NUM` define
* at run-time by calling `mp_warray_init()`

The internal structure can only be created once. If one wants to modify
the maximum number of elements, the entire structure has to be free'd
by calling `mp_warray_free()`.

In case one wants to use this option with multiple threads, one shall
use the `mp_warray_init()` function and pass appropriate locking functions.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-03-27 16:12:02 +01:00
Steffen Jaeckel
b57b2cdd5e v1.3.0
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQR7JLxzr+76aaW96cU/qpSzvZAW2QUCZgQfbQAKCRA/qpSzvZAW
 2SGZAP4lHiWQZg3fVypEhIHbkLOiV+HRrY8cvrZBM2n7G1i/cAD/UHI4GGMTz4DC
 7dn62UpQwddM1LfkBYqz+Fp6CrMXUQQ=
 =PAoW
 -----END PGP SIGNATURE-----

Merge tag 'v1.3.0' into develop

v1.3.0
2024-03-27 14:41:25 +01:00
Steffen Jaeckel
832dd08aa8 Update version & changelog
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-03-19 17:14:42 +01:00
Daniel Mendler
f1a0a66d01 suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now
(cherry picked from commit f6a7bedb95)
2024-03-13 17:38:54 +01:00
Steffen Jaeckel
8ce69f7b5e v1.2.1
-----BEGIN PGP SIGNATURE-----
 
 iIMEABYIACsWIQR7JLxzr+76aaW96cU/qpSzvZAW2QUCZPXUwA0cc0BqYWVja2Vs
 LmV1AAoJED+qlLO9kBbZSkIBAKLAcdrhuRf7XNWn7dPYDFfIBVMBvfMtOUvNYu3a
 AeROAQCT+NDlQen9CvhSN2mijNbgqpJpFltUSCFaxyyQj83BDQ==
 =cbsG
 -----END PGP SIGNATURE-----

Merge tag 'v1.2.1' into develop

v1.2.1
2023-09-05 16:31:28 +02:00
Steffen Jaeckel
f6b65b90d9 Update version
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-09-04 14:44:14 +02:00
宇文
a2c6b09dfe update docs 2023-08-26 13:12:44 +02:00
Steffen Jaeckel
1dbad38038 Fix building docs
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 16:52:18 +02:00
Steffen Jaeckel
e76244976d Install manpage and add it to the release tarball
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-21 20:24:18 +02:00
Steffen Jaeckel
733cb22e31 Add missing APIs&Macros to manpage
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-21 17:03:37 +02:00
Steffen Jaeckel
c166d76094 Trim trailing spaces
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-21 17:01:20 +02:00
czurnieden
72a0907166 addition of a man-page 2023-06-21 17:01:20 +02:00
czurnieden
5c4f5d9c0c added macro mp_isone 2023-06-21 14:10:44 +02:00
czurnieden
3be34b15c5 Expansion of mp_log to the full range together with the extension of mp_log to bigint bases. 2023-04-09 05:45:38 +02:00
Steffen Jaeckel
c7686f2467 slightly edit, update and run typos.sh
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-10-03 12:13:21 +02:00
Steffen Jaeckel
f37f620598 add mp_hash doc
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-03-14 10:30:50 +01:00
czurnieden
24ac0de688 Replaced "fgets" with a "get_token" function in demo/mtest_opponent.c 2020-12-29 20:49:25 +01:00
Horst H. von Brand
96bfafae7c Documentation: Kludge for decent "mod" operation
[skip ci]

Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2020-12-20 12:51:50 +01:00
Horst H. von Brand
eb7520213c Documentation: Grammo
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2020-12-20 12:49:30 +01:00
Horst H. von Brand
64bb3aa2fe Documentation: Fix Format mp_rand_source
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2020-12-20 12:49:30 +01:00
Horst H. von Brand
a1a057b5df Documentation: Fix /dev/urandom
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2020-12-20 12:49:30 +01:00
Horst H. von Brand
ae29a38ca5 Documentation: Fix an exponent
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2020-12-20 12:49:30 +01:00
czurnieden
1e65c0bfe4
Introduction of a fast but slightly over-estimating radix_size 2019-12-04 21:39:02 +01:00
Daniel Mendler
b800b7610a
remove *_ll* setters/getters
* they are non standard
* they are incompatible with older compilers
* u64/i64 functions should be used instead
* these functions should be deprecated again in 1.x
2019-11-25 11:14:48 +01:00
Daniel Mendler
f6a7bedb95 suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
Daniel Mendler
c47d5e87b2
s_mp_rand_platform: add comment regarding MP_HAS requiring dead code elim 2019-11-12 01:16:33 +01:00
Daniel Mendler
4f00e75b8f
make mp_div_3 private 2019-11-09 06:43:58 +01:00
Daniel Mendler
b9977adfb8
use uint8_t instead of unsigned char 2019-10-29 17:40:59 +01:00
Daniel Mendler
2122b51139
manual: don't mention obsolete MP_DIV_SMALL 2019-10-27 21:53:17 +01:00
Steffen Jaeckel
e2f8df3358 fix doc [skip ci]
+ ignore bak files generated by latexindent
+ silence latexindent
2019-10-27 21:19:37 +01:00
Daniel Mendler
d27dff92f0
update manual: replace mp_bool/MP_YES/MP_NO references by bool/true/false 2019-10-27 18:41:58 +01:00
Steffen Jaeckel
8862ca830e fix index
added new API functions found by `helper.pl -d`

removed old API functions found via

```sh
awk -F',' '/item/ {print $1}' doc/bn.ind | \
	awk '/mp/ {print $2}' | \
	sed -e 's/\\//g' | \
	xargs -I {} sh -c "grep -q {} tommath.h || echo {}"
```
2019-10-27 16:29:30 +01:00
czurnieden
2efbdd543c
more clean-ups and addition of a latexinden.pl configuration file 2019-10-27 14:57:37 +01:00
czurnieden
3947ffda95
backup 2019-10-27 14:57:37 +01:00
czurnieden
8b31c193bf
Cleanup and update of manual 2019-10-27 14:57:37 +01:00
Steffen Jaeckel
d06e2986ca v1.2.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 Comment: Gnu Privacy Tools
 
 iF4EABEIAAYFAl2uz5oACgkQrwyxdiHtrXLIngD/WoeRRt9sYkjNiSmiKYuBvgAi
 pF0Sdfe7vAAhY3jpRX0A/2rJdJFGiFiuAB72qWiGJZg0Rr+kbOGwKfvYgE6jROw6
 =EL7p
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 Comment: Gnu Privacy Tools
 
 iF4EABEIAAYFAl2u0EEACgkQrwyxdiHtrXIQkQD+I8Z6IYTtVmG0patanpT1EFyA
 SZUKP2z50owej4uF3QAA/32m1dmpG6MSYhfu9zu4435PwaI+RgCaUrZ1YaoWroXJ
 =agqw
 -----END PGP SIGNATURE-----

Merge tag 'v1.2.0' into develop

v1.2.0
2019-10-22 11:47:42 +02:00
Steffen Jaeckel
35178bfdb4 fixup c917f3c391 2019-10-20 19:18:29 +02:00
Steffen Jaeckel
c917f3c391 also remove poster 2019-10-20 18:27:56 +02:00
Steffen Jaeckel
17ca193fa7 remove LTM book
reuse `docs` make-target to build poster and manual

fixes #383
2019-10-20 17:20:30 +02:00
Steffen Jaeckel
7a68f12873 Execute move.sh - Rename files from bn_* to match the function names.
* git blame <renamed-file> is not affected
* git log --follow <renamed-file> can be used to show log across renames
2019-10-19 16:24:39 +02:00
czurnieden
36fca2f9a0
remove support for 8-bit (MP_8BIT) 2019-10-19 16:03:26 +02:00
Daniel Mendler
55acc6ab5b
update docs 2019-10-17 16:56:30 +02:00
Steffen Jaeckel
ef1675f1ac add missing indexes in doc 2019-10-16 14:30:45 +02:00
Steffen Jaeckel
8adc90411a bump version 2019-10-15 21:12:21 +02:00
czurnieden
3dd542f2fe Changed macro 'LTM_USE_FIPS_ONLY' to 'LTM_USE_ONLY_MR' 2019-10-14 23:05:56 +02:00
czurnieden
cf08afa498 Update to list of number of Miller-Rabin trials 2019-10-14 20:50:48 +02:00
czurnieden
b6813a4122
replace mp_export/import by mp_pack/unpack 2019-10-08 22:30:25 +02:00
czurnieden
71d1b7b9d8 make mp_to_radix return the count of characters of the converted number 2019-10-06 21:26:49 +02:00
czurnieden
abdb033402 Refactored functions to read and write binaries and added "maxlen" 2019-10-06 03:38:16 +02:00