Commit Graph

200 Commits

Author SHA1 Message Date
Conrado Gouvea d42e6ae478 use stack for table in Scalar::invert() to prevent leaking values to the heap 2023-07-13 14:44:36 -03:00
Conrado Gouvea ed18a112f3
fix FieldElement56::negate (fix mentioned by @pornin in #28) (#29) 2023-07-12 23:14:26 +01:00
进栈检票 30946a3dcb
Some "cleanup" works (#27)
* feature rand

* use hex-literal in test cases

* bump to edition 2021
2023-05-19 13:32:12 +01:00
Kevaundray Wedderburn 2adc09fb6b update to 0.9 2023-03-10 23:31:05 +00:00
Kevaundray Wedderburn f4b79838ee Merge branch 'develop' 2023-03-10 23:29:51 +00:00
Conrado Gouvea ec4c7c81d5
add Scalar::to_bytes_rfc_8032() (#25) 2023-03-10 22:52:32 +00:00
Conrado Gouvea 54ffc6b8f1
add Scalar::from_canonical_bytes(), from_bytes_mod_order_wide() and random() (#23) 2022-12-01 23:21:24 +00:00
Conrado Gouvea 9ebb11c775
fix bugs in ExtendedPoint::compress and decompress (#22) 2022-12-01 20:48:19 +00:00
An Onion 0da8969a6f
derive Hash for MontgomeryPoint (#21) 2022-02-04 00:05:38 +00:00
An Onion 448597e600
allow non snake case names (#20) 2022-02-04 00:04:43 +00:00
Kevaundray Wedderburn aab05bc3a9 update version 2022-01-31 21:13:19 +00:00
An Onion 9fbc3bbef4
add optional Zeroize support for MontgomeryPoint (#19) 2022-01-31 21:10:45 +00:00
Kevaundray Wedderburn 1e6ec0938e Decaf
derive debug
2021-02-07 20:23:13 +00:00
Kevaundray Wedderburn feb4808180 Decaf
Implement Mul, Sub and Neg for DecafPoint and put them in an ops folder
2021-02-07 20:15:23 +00:00
Kevaundray Wedderburn 2bfabe90fe Decaf
Change `encode` and `decode` to `compress` and `decode` respectively
2021-02-07 19:50:02 +00:00
Kevaundray Wedderburn f81402eb22 cargo toml
update patch
2021-02-07 19:46:34 +00:00
Kevaundray Wedderburn 8add69f9c2 Decaf
Add the other variants for multiplication
2021-02-07 19:46:14 +00:00
Kevaundray Wedderburn ce7e9b183b cargo toml
update patch
2021-02-07 19:26:34 +00:00
Kevaundray Wedderburn b9e9312698 Decaf
Add a method for ScalarMul with DecafPoint
2021-02-07 19:25:57 +00:00
Kevaundray Wedderburn 7fdcb6d02d impl Mul trait for Montgomery 2020-05-30 19:17:34 +01:00
Kevaundray Wedderburn d01d77fa5e update cargo.toml 2020-05-30 16:46:36 +01:00
Kevaundray Wedderburn 41364e6010 update reade 2020-05-30 16:45:40 +01:00
Kevaundray Wedderburn 618d0968cd add as_bytes method for montgomery 2020-05-30 16:45:12 +01:00
Kevaundray Wedderburn 71965a697b fix_comment 2020-05-30 15:56:39 +01:00
Kevaundray Wedderburn 5867d5d912 update version 2020-05-30 15:46:16 +01:00
Kevaundray Wedderburn 7057d9006d Add low order points on the montgomery curve, and a function to return the generator specified in RFC7748 2020-05-30 15:45:54 +01:00
Kevaundray Wedderburn 73a7ecf466 change default backend 2020-05-27 18:20:24 +01:00
Kevaundray Wedderburn 03e086f2cb add dalek copyright 2020-05-27 18:18:35 +01:00
Kevaundray Wedderburn 8e9afd58bd Add new addition chain for inversion in F_p 2020-05-23 20:35:54 +01:00
Kevaundray Wedderburn 0ea8352bba remove duplicate test 2020-05-22 20:46:52 +01:00
Kevaundray Wedderburn 1b908bd1e2 - Temporarily remove signed multi comb scalar multiplication [Readability]
- Add in wnaf scalar multiplication
2020-05-22 20:44:20 +01:00
Kevaundray Wedderburn f7f92143c4 Refactor identity method for to_projective_niels() method 2020-05-22 20:42:58 +01:00
Kevaundray Wedderburn 1e2497b503 - remove &mut from add_projective_neils method
- Switch around t1 and t2, for the identity, just to be consistent with x and y
2020-05-22 20:41:59 +01:00
Kevaundray Wedderburn 28a3638070 refactor 4-isogeny to only use 1 inversion 2020-05-22 20:41:00 +01:00
Kevaundray Wedderburn 681cf51b4c rename test name to be more descriptive 2020-05-22 20:40:15 +01:00
Kevaundray Wedderburn 8361bcfa7b recode scalars to be between -8 and 8 2020-05-22 20:39:53 +01:00
Kevaundray Wedderburn b8338be937 update readme 2020-05-19 22:12:31 +01:00
Kevaundray Wedderburn 4de41fdcc0 Remove conditional_assign and conditional_swap as they can be derived from conditional_select 2020-05-19 22:09:52 +01:00
Kevaundray Wedderburn b3154fde89 - Move equality of field elements to the Field element layer
- Move is_zero method to field element layer
2020-05-19 22:07:42 +01:00
Kevaundray Wedderburn fddfd1a996 remove unused comment 2020-05-19 21:50:47 +01:00
Kevaundray Wedderburn 397b7ac2ba Refactor tests to be generic over the field element backend chosen 2020-05-19 21:41:17 +01:00
Kevaundray Wedderburn 169e28351c - Remove to_extensible method from affine. 2020-05-19 21:26:23 +01:00
Kevaundray Wedderburn 1d1d246461 add fiat_u64 backend feature for constants 2020-05-19 21:25:43 +01:00
Kevaundray Wedderburn 1e3353169b Add test to derive the basepoints 2020-05-19 21:24:57 +01:00
Kevaundray Wedderburn f2a918631c Remove duplicated methods 2020-05-19 21:21:00 +01:00
Kevaundray Wedderburn 01ec6ca3fb Add backend for radix 2^56 using fiat-crypto 2020-05-19 21:20:14 +01:00
Kevaundray Wedderburn bd65f9215b - Rename Fq to FieldElement28
- Rename fq.rs to prime_field.rs
- As we only have 1 implementation for scalar.rs , move it to the top level temporarily
2020-05-19 21:18:40 +01:00
Kevaundray Wedderburn df007a8d0b - Replace select_mask with ct_eq
- Remove test vectors (not helpful with two backends)
- Replace all u28 field elements with generic field elements
2020-05-19 21:16:28 +01:00
Kevaundray Wedderburn 77e81520c6 remove select mask method 2020-05-19 21:12:38 +01:00
Kevaundray Wedderburn dda5f3028e simplify basic inversion test 2020-05-11 19:41:12 +01:00