@@ -4,6 +4,229 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## 0.6.0 (2025-01-22)
8
+ ### Added
9
+ - ` TryFrom<&[u8]> ` bound on ` Encoding::Repr ` ([ #261 ] )
10
+ - New ` Uint ` functionality:
11
+ - New methods: ` bitand_limb ` ([ #322 ] ), ` gcd ` ([ #472 ] ), ` from_str_radix_vartime ` ([ #603 ] ),
12
+ ` to_string_radix_vartime ` ([ #659 ] )
13
+ - New trait impls: ` MulMod ` ([ #313 ] ), ` Div ` /` Rem ` ([ #720 ] )
14
+ - New ` BoxedUint ` functionality:
15
+ - New methods: ` sbb ` /` wrapping_sub ` /` checked_sub ` ([ #303 ] ), ` mul ` ([ #306 ] ),
16
+ ` from_be_slice ` /` from_le_slice ` ([ #307 ] ), ` to_be_bytes ` /` to_le_bytes ` ([ #308 ] ),
17
+ ` bits ` ([ #328 ] ), ` conditional_select ` ([ #329 ] ), ` shl_vartime ` ([ #330 ] ), ` shr_vartime ` ([ #331 ] ),
18
+ ` rem_vartime ` ([ #332 ] ), ` inv_mod2k ` /` bitor ` ([ #334 ] ), ` pow ` ([ #337 ] ), ` inv_mod ` ([ #341 ] ),
19
+ ` random ` ([ #349 ] ), ` cond_map ` /` cond_and_then ` ([ #352 ] ), ` map_limbs ` ([ #357 ] ),
20
+ ` div_rem ` /` rem ` ([ #398 ] ), ` new_with_arc ` ([ #407 ] ), ` gcd ` ([ #497 ] ),
21
+ ` from_str_radix_vartime ` ([ #603 ] ), ` to_string_radix_vartime ` ([ #659 ] )
22
+ - New trait impls: ` BitAnd* ` ([ #314 ] ), ` ConstantTimeGreater/Less ` /` PartialOrd/Ord ` ([ #316 ] ),
23
+ ` AddMod ` ([ #317 ] ), ` SubMod ` ([ #320 ] ), ` Hash ` /` BoxedUint ` ([ #350 ] ),
24
+ ` MulMod ` /` BoxedUint ` ([ #343 ] ), ` RandomMod ` ([ #349 ] ), ` Rem ` ([ #356 ] ), ` BitNot ` /` BitXor ` ([ #358 ] ),
25
+ ` CheckedMul ` /` Mul ` ([ #361 ] ), ` NegMod ` ([ #362 ] ), ` Div ` ([ #366 ] ), ` Integer ` ([ #367 ] )
26
+ - Montgomery multiplication support ([ #323 ] )
27
+ - New traits: ` FixedInteger ` ([ #363 ] ), ` CheckedDiv ` ([ #369 ] ), ` WideningMul ` ([ #371 ] ),
28
+ ` ConstantTimeSelect ` ([ #454 ] ), ` SquareAssign ` ([ #431 ] ), ` Gcd ` ([ #499 ] ),
29
+ ` DivRemLimb ` /` RemLimb ` ([ #496 ] ), ` InvMod ` ([ #505 ] , [ #741 ] ), ` SquareRoot ` ([ #508 ] ),
30
+ ` BitOperations ` ([ #507 ] ), ` ShrVartime ` /` ShlVartime ` ([ #509 ] ), ` RandomBits ` ([ #510 ] ),
31
+ ` RemMixed ` ([ #746 ] )
32
+ - ` num-traits ` impls: ` Wrapping* ` ([ #425 ] ), ` Zero ` /` One ` ([ #433 ] ), ` ConstZero ` ([ #573 ] ),
33
+ ` Num ` ([ #720 ] )
34
+ - safegcd (Bernstein-Yang) GCD + inv mod algorithm ([ #372 ] , [ #493 ] , [ #632 ] , [ #635 ] , [ #655 ] )
35
+ - Constant-time square root and division ([ #376 ] )
36
+ - Implement ` Zeroize ` for ` NonZero ` wrapper ([ #406 ] )
37
+ - ` Zero::set_zero ` method ([ #426 ] )
38
+ - ` Inverter ` /` PrecomputeInverter ` traits ([ #438 ] , [ #444 ] )
39
+ - Uint: ` const fn ` encoders ([ #453 ] )
40
+ - Traits to connect integers and Montgomery form representations ([ #431 ] ):
41
+ - ` Integer::Monty ` associated type
42
+ - ` Monty ` trait with arithmetic bounds and an associated ` Monty::Integer ` type
43
+ - ` Odd ` wrapper type ([ #487 ] )
44
+ - ` NonZero::new_unwrap ` ([ #602 ] )
45
+ - Implement Karatsuba multiplication for ` Uint ` and ` BoxedUint ` ([ #649 ] )
46
+ - Efficient linear combination for Montgomery forms ([ #666 ] )
47
+ - Doc comment support for ` impl_modulus! ` ([ #676 ] )
48
+ - ` core::error::Error ` support ([ #680 ] )
49
+ - ` Int ` type providing initial signed integer support using two's complement ([ #695 ] , [ #730 ] )
50
+ - Variable-time modular inversion support ([ #731 ] )
51
+
52
+ ### Changed
53
+ - Toplevel ` modular ` module now contains all modular functionality ([ #300 ] , [ #324 ] )
54
+ - ` Integer ` trait: expand bounds to include ` *Mod ` ([ #318 ] ), ` Add ` /` Sub ` /` Mul ` ([ #435 ] ),
55
+ ` RemAssign ` ([ #709 ] ), ` AddAssign ` /` MulAssign ` /` SubAssign ` ([ #716 ] )
56
+ - ` Integer ` trait: add new methods ` bits(_vartime) ` /` leading_zeros ` ([ #368 ] ),
57
+ ` from_limb_like/ ` one_like` / ` zero_like` ([ #533 ] )
58
+ - Replace ` BoxedUint::new ` with ` ::zero_with_precision ` ([ #327 ] )
59
+ - Split ` Zero ` trait into ` Zero ` + ` ZeroConstant ` ([ #335 ] )
60
+ - Refactor ` Integer ` trait; add ` Constants ` /` LimbsConstant ` ([ #355 ] )
61
+ - The existing ` Bounded ` trait subsumes ` BITS ` /` BYTES `
62
+ - ` Constants ` provides ` ONE ` and ` MAX `
63
+ - ` LimbsConstant ` provides ` LIMBS `
64
+ - Rename ` BoxedUint::mul_wide ` to ` mul ` ([ #359 ] )
65
+ - Round up ` bits_precision ` when creating ` BoxedUint ` ([ #365 ] )
66
+ - Make bit ops use ` u32 ` for shifts and bit counts ([ #373 ] )
67
+ - Align with ` core ` /` std ` on overflow behavior for bit shifts ([ #395 ] )
68
+ - Make ` inv_mod2k(_vartime) ` return a ` CtChoice ` ([ #416 ] )
69
+ - Rename ` CtChoice ` to ` ConstChoice ` ([ #417 ] )
70
+ - Make division methods take ` NonZero ` -wrapped divisors ([ #419 ] )
71
+ - Align with ` core ` /` std ` on ` overflowing_sh* ` for functions which return an overflow flag ([ #430 ] )
72
+ - ` Uint ` : rename ` HLIMBS ` to ` RHS_LIMBS ` ([ #432 ] )
73
+ - Bring ` Checked* ` traits in line with ` Wrapping* ` ([ #434 ] )
74
+ - Rename ` *Residue* ` types i.e. Montgomery form representations ([ #485 ] ):
75
+ - ` Residue ` -> ` ConstMontyForm `
76
+ - ` DynResidue ` -> ` MontyForm `
77
+ - ` BoxedResidue ` -> ` BoxedMontyForm `
78
+ - ` *ResidueParams ` -> ` *MontyParams `
79
+ - ` residue_params ` -> ` params `
80
+ - ` params.r ` -> ` params.one `
81
+ - Make ` Monty::new_params() ` take an ` Odd ` -wrapped modulus ([ #488 ] )
82
+ - Expand ` Uint ` support for ` const fn ` : ` square ` ([ #514 ] ), ` widening_mul ` ([ #515 ] ),
83
+ ` to_le_bytes ` ([ #555 ] )
84
+ - Have ` (Boxed)MontyParams::modulus ` return ` &Odd<_> ` ([ #517 ] )
85
+ - Split ` MontyParams::new ` and ` new_vartime ` ([ #516 ] , [ #518 ] )
86
+ - Reverse ` Concat(Mixed) ` /` Split(Mixed) ` argument ordering ([ #526 ] )
87
+ - Migrate from ` generic-array ` to ` hybrid-array ` ([ #544 ] )
88
+ - Replace ` ZeroConstant ` with ` ConstZero ` trait from ` num-traits ` ([ #546 ] , [ #573 ] )
89
+ - Change ` Uint::concat_mixed ` and ` split_mixed ` to accept ` self ` ; make ` pub ` ([ #556 ] , [ #558 ] )
90
+ - Make ` Uint::concat ` and ` split ` const generic over inputs ([ #557 ] , [ #558 ] )
91
+ - Split ` Uint::mul_mod ` and ` Uint::mul_mod_vartime ` ([ #623 ] )
92
+ - Faster constant-time division ([ #643 ] )
93
+ - ` BoxedMontyForm ` : always use ` Arc ` for ` params ` ([ #645 ] )
94
+ - Leverage ` const_mut_refs ` ; MSRV 1.83 ([ #667 ] )
95
+ - Bump ` rlp ` dependency from 0.5 to 0.6 ([ #673 ] )
96
+ - Require ` RngCore ` instead of ` CryptoRngCore ` for various random methods ([ #710 ] )
97
+ - Bump ` serdect ` dependency to v0.3 ([ #719 ] )
98
+ - Have ` rand ` feature enable ` rand_core/getrandom ` instead of ` rand_core/std ` ([ #745 ] )
99
+
100
+ ### Fixed
101
+ - Argument ordering to ` BoxedUint::chain ` ([ #315 ] )
102
+ - Modulus leading zeros calculation for ` MontyForm ` /` BoxedMontyForm ` ([ #713 ] )
103
+
104
+ ### Removed
105
+ - ` ct_* ` prefixes from method names since we're constant-time by default ([ #417 ] )
106
+ - ` const_assert_* ` macros ([ #452 ] , [ #690 ] )
107
+
108
+ [ #261 ] : https://github.com/RustCrypto/crypto-bigint/pull/261
109
+ [ #300 ] : https://github.com/RustCrypto/crypto-bigint/pull/300
110
+ [ #303 ] : https://github.com/RustCrypto/crypto-bigint/pull/303
111
+ [ #306 ] : https://github.com/RustCrypto/crypto-bigint/pull/306
112
+ [ #307 ] : https://github.com/RustCrypto/crypto-bigint/pull/307
113
+ [ #308 ] : https://github.com/RustCrypto/crypto-bigint/pull/308
114
+ [ #313 ] : https://github.com/RustCrypto/crypto-bigint/pull/313
115
+ [ #314 ] : https://github.com/RustCrypto/crypto-bigint/pull/314
116
+ [ #315 ] : https://github.com/RustCrypto/crypto-bigint/pull/315
117
+ [ #316 ] : https://github.com/RustCrypto/crypto-bigint/pull/316
118
+ [ #317 ] : https://github.com/RustCrypto/crypto-bigint/pull/317
119
+ [ #318 ] : https://github.com/RustCrypto/crypto-bigint/pull/318
120
+ [ #320 ] : https://github.com/RustCrypto/crypto-bigint/pull/320
121
+ [ #322 ] : https://github.com/RustCrypto/crypto-bigint/pull/322
122
+ [ #323 ] : https://github.com/RustCrypto/crypto-bigint/pull/323
123
+ [ #324 ] : https://github.com/RustCrypto/crypto-bigint/pull/324
124
+ [ #327 ] : https://github.com/RustCrypto/crypto-bigint/pull/327
125
+ [ #328 ] : https://github.com/RustCrypto/crypto-bigint/pull/328
126
+ [ #329 ] : https://github.com/RustCrypto/crypto-bigint/pull/329
127
+ [ #330 ] : https://github.com/RustCrypto/crypto-bigint/pull/330
128
+ [ #331 ] : https://github.com/RustCrypto/crypto-bigint/pull/331
129
+ [ #332 ] : https://github.com/RustCrypto/crypto-bigint/pull/332
130
+ [ #334 ] : https://github.com/RustCrypto/crypto-bigint/pull/334
131
+ [ #335 ] : https://github.com/RustCrypto/crypto-bigint/pull/335
132
+ [ #337 ] : https://github.com/RustCrypto/crypto-bigint/pull/337
133
+ [ #341 ] : https://github.com/RustCrypto/crypto-bigint/pull/341
134
+ [ #343 ] : https://github.com/RustCrypto/crypto-bigint/pull/343
135
+ [ #349 ] : https://github.com/RustCrypto/crypto-bigint/pull/349
136
+ [ #350 ] : https://github.com/RustCrypto/crypto-bigint/pull/350
137
+ [ #352 ] : https://github.com/RustCrypto/crypto-bigint/pull/352
138
+ [ #355 ] : https://github.com/RustCrypto/crypto-bigint/pull/355
139
+ [ #356 ] : https://github.com/RustCrypto/crypto-bigint/pull/356
140
+ [ #357 ] : https://github.com/RustCrypto/crypto-bigint/pull/357
141
+ [ #358 ] : https://github.com/RustCrypto/crypto-bigint/pull/358
142
+ [ #359 ] : https://github.com/RustCrypto/crypto-bigint/pull/359
143
+ [ #361 ] : https://github.com/RustCrypto/crypto-bigint/pull/361
144
+ [ #362 ] : https://github.com/RustCrypto/crypto-bigint/pull/362
145
+ [ #363 ] : https://github.com/RustCrypto/crypto-bigint/pull/363
146
+ [ #365 ] : https://github.com/RustCrypto/crypto-bigint/pull/365
147
+ [ #366 ] : https://github.com/RustCrypto/crypto-bigint/pull/366
148
+ [ #367 ] : https://github.com/RustCrypto/crypto-bigint/pull/367
149
+ [ #368 ] : https://github.com/RustCrypto/crypto-bigint/pull/368
150
+ [ #369 ] : https://github.com/RustCrypto/crypto-bigint/pull/369
151
+ [ #371 ] : https://github.com/RustCrypto/crypto-bigint/pull/371
152
+ [ #372 ] : https://github.com/RustCrypto/crypto-bigint/pull/372
153
+ [ #373 ] : https://github.com/RustCrypto/crypto-bigint/pull/373
154
+ [ #376 ] : https://github.com/RustCrypto/crypto-bigint/pull/376
155
+ [ #395 ] : https://github.com/RustCrypto/crypto-bigint/pull/395
156
+ [ #398 ] : https://github.com/RustCrypto/crypto-bigint/pull/398
157
+ [ #406 ] : https://github.com/RustCrypto/crypto-bigint/pull/406
158
+ [ #407 ] : https://github.com/RustCrypto/crypto-bigint/pull/407
159
+ [ #416 ] : https://github.com/RustCrypto/crypto-bigint/pull/416
160
+ [ #417 ] : https://github.com/RustCrypto/crypto-bigint/pull/417
161
+ [ #419 ] : https://github.com/RustCrypto/crypto-bigint/pull/419
162
+ [ #425 ] : https://github.com/RustCrypto/crypto-bigint/pull/425
163
+ [ #426 ] : https://github.com/RustCrypto/crypto-bigint/pull/426
164
+ [ #430 ] : https://github.com/RustCrypto/crypto-bigint/pull/430
165
+ [ #431 ] : https://github.com/RustCrypto/crypto-bigint/pull/431
166
+ [ #432 ] : https://github.com/RustCrypto/crypto-bigint/pull/432
167
+ [ #433 ] : https://github.com/RustCrypto/crypto-bigint/pull/433
168
+ [ #434 ] : https://github.com/RustCrypto/crypto-bigint/pull/434
169
+ [ #435 ] : https://github.com/RustCrypto/crypto-bigint/pull/435
170
+ [ #438 ] : https://github.com/RustCrypto/crypto-bigint/pull/438
171
+ [ #444 ] : https://github.com/RustCrypto/crypto-bigint/pull/444
172
+ [ #452 ] : https://github.com/RustCrypto/crypto-bigint/pull/452
173
+ [ #453 ] : https://github.com/RustCrypto/crypto-bigint/pull/453
174
+ [ #454 ] : https://github.com/RustCrypto/crypto-bigint/pull/454
175
+ [ #472 ] : https://github.com/RustCrypto/crypto-bigint/pull/472
176
+ [ #485 ] : https://github.com/RustCrypto/crypto-bigint/pull/485
177
+ [ #487 ] : https://github.com/RustCrypto/crypto-bigint/pull/487
178
+ [ #488 ] : https://github.com/RustCrypto/crypto-bigint/pull/488
179
+ [ #493 ] : https://github.com/RustCrypto/crypto-bigint/pull/493
180
+ [ #496 ] : https://github.com/RustCrypto/crypto-bigint/pull/496
181
+ [ #497 ] : https://github.com/RustCrypto/crypto-bigint/pull/497
182
+ [ #499 ] : https://github.com/RustCrypto/crypto-bigint/pull/499
183
+ [ #505 ] : https://github.com/RustCrypto/crypto-bigint/pull/505
184
+ [ #507 ] : https://github.com/RustCrypto/crypto-bigint/pull/507
185
+ [ #508 ] : https://github.com/RustCrypto/crypto-bigint/pull/508
186
+ [ #509 ] : https://github.com/RustCrypto/crypto-bigint/pull/509
187
+ [ #510 ] : https://github.com/RustCrypto/crypto-bigint/pull/510
188
+ [ #514 ] : https://github.com/RustCrypto/crypto-bigint/pull/514
189
+ [ #515 ] : https://github.com/RustCrypto/crypto-bigint/pull/515
190
+ [ #517 ] : https://github.com/RustCrypto/crypto-bigint/pull/517
191
+ [ #518 ] : https://github.com/RustCrypto/crypto-bigint/pull/518
192
+ [ #526 ] : https://github.com/RustCrypto/crypto-bigint/pull/526
193
+ [ #533 ] : https://github.com/RustCrypto/crypto-bigint/pull/533
194
+ [ #544 ] : https://github.com/RustCrypto/crypto-bigint/pull/544
195
+ [ #546 ] : https://github.com/RustCrypto/crypto-bigint/pull/546
196
+ [ #555 ] : https://github.com/RustCrypto/crypto-bigint/pull/555
197
+ [ #556 ] : https://github.com/RustCrypto/crypto-bigint/pull/556
198
+ [ #557 ] : https://github.com/RustCrypto/crypto-bigint/pull/557
199
+ [ #558 ] : https://github.com/RustCrypto/crypto-bigint/pull/558
200
+ [ #573 ] : https://github.com/RustCrypto/crypto-bigint/pull/573
201
+ [ #602 ] : https://github.com/RustCrypto/crypto-bigint/pull/602
202
+ [ #603 ] : https://github.com/RustCrypto/crypto-bigint/pull/603
203
+ [ #623 ] : https://github.com/RustCrypto/crypto-bigint/pull/623
204
+ [ #632 ] : https://github.com/RustCrypto/crypto-bigint/pull/632
205
+ [ #635 ] : https://github.com/RustCrypto/crypto-bigint/pull/635
206
+ [ #643 ] : https://github.com/RustCrypto/crypto-bigint/pull/643
207
+ [ #645 ] : https://github.com/RustCrypto/crypto-bigint/pull/645
208
+ [ #649 ] : https://github.com/RustCrypto/crypto-bigint/pull/649
209
+ [ #655 ] : https://github.com/RustCrypto/crypto-bigint/pull/655
210
+ [ #659 ] : https://github.com/RustCrypto/crypto-bigint/pull/659
211
+ [ #666 ] : https://github.com/RustCrypto/crypto-bigint/pull/666
212
+ [ #667 ] : https://github.com/RustCrypto/crypto-bigint/pull/667
213
+ [ #673 ] : https://github.com/RustCrypto/crypto-bigint/pull/673
214
+ [ #676 ] : https://github.com/RustCrypto/crypto-bigint/pull/676
215
+ [ #680 ] : https://github.com/RustCrypto/crypto-bigint/pull/680
216
+ [ #690 ] : https://github.com/RustCrypto/crypto-bigint/pull/690
217
+ [ #695 ] : https://github.com/RustCrypto/crypto-bigint/pull/695
218
+ [ #709 ] : https://github.com/RustCrypto/crypto-bigint/pull/709
219
+ [ #710 ] : https://github.com/RustCrypto/crypto-bigint/pull/710
220
+ [ #713 ] : https://github.com/RustCrypto/crypto-bigint/pull/713
221
+ [ #716 ] : https://github.com/RustCrypto/crypto-bigint/pull/716
222
+ [ #719 ] : https://github.com/RustCrypto/crypto-bigint/pull/719
223
+ [ #720 ] : https://github.com/RustCrypto/crypto-bigint/pull/720
224
+ [ #730 ] : https://github.com/RustCrypto/crypto-bigint/pull/730
225
+ [ #731 ] : https://github.com/RustCrypto/crypto-bigint/pull/731
226
+ [ #741 ] : https://github.com/RustCrypto/crypto-bigint/pull/741
227
+ [ #745 ] : https://github.com/RustCrypto/crypto-bigint/pull/745
228
+ [ #746 ] : https://github.com/RustCrypto/crypto-bigint/pull/746
229
+
7
230
## 0.5.5 (2023-11-18)
8
231
### Added
9
232
- Multi-exponentiation ([ #248 ] )
0 commit comments