Helder Eijs
3b20e96ffa
Add PYCRYPTODOME_DISABLE_GMP flag and simplify to_bytes() for GMP
2024-01-13 18:41:36 +01:00
Helder Eijs
afb5e27a15
Fix side-channel leakage in RSA decryption
2023-12-25 01:30:40 +01:00
Helder Eijs
764c1e81b9
Add Ed25519 keys and EdDSA signatures
2022-05-08 22:35:37 +02:00
Helder Eijs
2e7dad9a9f
Fix GH#505 and GH#509: Fix segmentation faults with GMP on Aarch64
...
Do not use GMP sscanf and snprintf. Instead, convert integers into
and from GMP using pure arithmetic operations.
2021-09-22 00:46:56 +02:00
Helder Eijs
f499fd3756
Better message when avoiding GMP on Windows
2020-06-14 23:35:31 +02:00
Helder Eijs
9583c3b8d8
Allow hex() on custom integers
2019-02-11 12:12:41 +01:00
Helder Eijs
334f8d8c08
Fix test case (64+1 bytes for modulus)
2019-02-05 09:36:47 +01:00
Helder Eijs
20669841e0
New ERR_MODULUS error code
2019-02-05 09:36:47 +01:00
Helder Eijs
e777249231
New monty_pow() requires base smaller than modulus
2019-02-05 09:36:47 +01:00
Helder Eijs
5ddd27932c
Move monty_pow() output parameter to 1st position
2019-02-05 09:36:47 +01:00
Helder Eijs
fa933ab29e
Make mypy test pass
...
In the process, refactor Crypto.Math to make use of inheritance.
2018-11-23 23:07:14 +01:00
Helder Eijs
39626a5b01
Move functions to get buffer information into Util._raw_api
2018-11-04 22:05:09 +01:00
Helder Eijs
cd7f0128b6
Make code base suitable for Python 2 and 3 - stop using 2to3
2018-11-04 15:04:23 +01:00
Helder Eijs
066b8969ee
More cleanup
2018-10-16 22:09:53 +02:00
Helder Eijs
9990033025
Jacobi symbol not defined for negative n, add more test vectors
2018-08-10 12:58:41 +02:00
Helder Eijs
66fdb1fdd4
Increase testing for primality
2018-08-09 22:53:57 +02:00
Helder Eijs
ff6c0b78f1
Lucas test fail with prime from GH#188
2018-07-13 22:26:01 +02:00
Helder Eijs
4242e82e9e
Modern syntax for except statement
2018-06-12 14:15:39 +02:00
Helder Eijs
3f2be587f3
Add square root modulo prime
2018-02-14 23:50:54 +01:00
Helder Eijs
c502060ee7
Use c_ulonglong for seed
2018-01-22 00:41:09 +01:00
Helder Eijs
7b1249e718
Add custom implementation for modexp
2018-01-22 00:41:09 +01:00
Helder Eijs
640c0a9f7f
Rough benchmarker
2018-01-22 00:15:30 +01:00
Helder Eijs
6f88b8010a
More tests for modexp
2018-01-22 00:15:30 +01:00
Helder Eijs
d50627c13e
Modexp test for several integer lengths
2018-01-22 00:15:30 +01:00
Helder Eijs
836a1a22a3
More tests for modexp
2018-01-22 00:15:30 +01:00
Helder Eijs
8c366b28ff
Fix C declaration
2018-01-22 00:15:30 +01:00
Helder Eijs
f879f792c6
First unit test for modexp
2018-01-22 00:15:30 +01:00
Helder Eijs
4edda30930
Skeleton for unit tests of modexp module
2018-01-22 00:15:30 +01:00
Helder Eijs
88595c6fa3
Remove OverflowError from right shift
2018-01-08 12:01:49 +01:00
Helder Eijs
7d03599c65
Fix Integer.get_bit for negative values and overflows
...
It is not possible anymore to get a specific bit from a negative
integer (representation cannot be intuitive).
OverFlowError is not raised anymore (in line with
https://bugs.python.org/issue29816 )
2018-01-08 11:49:10 +01:00
Legrandin
e7112fa9d4
Add Math.Integer.size_in_bytes
2016-01-26 04:47:29 -05:00
Legrandin
c0176c8d32
Add in-place invert operation
2016-01-11 22:55:39 +01:00
Legrandin
92cbf23eba
Added in-place subtraction
2016-01-11 22:35:45 +01:00
Legrandin
8b15b12a81
Add in-place exponentiation for Integer
2016-01-11 08:33:00 +01:00
Legrandin
1cca0ff6c1
Add Integer.lcm() method
2015-03-05 21:54:07 +01:00
Legrandin
f928741c77
Add square root to Integer
2015-02-25 22:39:10 +01:00
Legrandin
00ab349550
Generic filter for prime number generation
2015-02-25 07:40:29 +01:00
Legrandin
f08e5f9506
On Windows, do not rely on ctypes.util.find_library().
2015-02-20 14:40:56 +00:00
Legrandin
0564cb7c3e
On Win64, use ulonglong instead ulong for MPIR
2015-02-10 12:50:02 +00:00
Legrandin
70e6625800
More tests for Integer initialization
2015-02-10 10:39:11 +00:00
Legrandin
c965c1ee84
Simplified Integer initialization with GMP
2015-02-09 22:22:21 +01:00
Legrandin
eb49715608
pow(), gcd() and inverse() methods return Integer
...
The three functions erroneously return a Python
integer and not an Crypto.Number.Integer when
using the fallback implementation (non-GMP).
2015-02-03 21:55:25 +01:00
Legrandin
fffdf87c4d
Fixed to test cases when GMP is missing
2015-02-02 22:32:54 +01:00
Legrandin
92d6fc6c08
Explicitly export symbols on Windows
2015-02-02 22:18:02 +01:00
Legrandin
eb03c331b3
Base RSA on Math module (WIP)
2014-12-06 12:04:12 +01:00
Legrandin
0d0e37a6f0
random_range takes only explicit keywords args
2014-12-06 12:04:12 +01:00
Legrandin
3e374a58c7
Bugfix: mpz_set() called on uninitialized MPZ
2014-12-06 12:04:12 +01:00
Legrandin
40fe460735
Added inverse, gcd, left shift and floor division to Integer
2014-12-06 12:04:11 +01:00
Legrandin
354ed29fba
Revisited tests, docs and added generate_probable_safe_prime
2014-12-06 12:04:11 +01:00
Legrandin
7efa10ed59
Additional optimizations for prime generation.
2014-12-06 12:04:11 +01:00