Pieter Wuille
a5759c572e
Check return value of malloc
2014-12-07 02:58:24 +01:00
Pieter Wuille
c35ff1ea44
Convert lambda splitter to pure scalar code.
...
This enables the use of the endomorphism optimization without bignum.
2014-12-02 16:50:00 +01:00
Peter Dettman
cc604e9842
Avoid division when decomposing scalars
...
- In secp256k1_gej_split_exp, there are two divisions used. Since the denominator is a constant known at compile-time, each can be replaced by a multiplication followed by a right-shift (and rounding).
- Add the constants g1, g2 for this purpose and rewrite secp256k1_scalar_split_lambda_var accordingly.
- Remove secp256k1_num_div since no longer used
Rebased-by: Pieter Wuille
2014-12-02 16:50:00 +01:00
Pieter Wuille
597128d389
Make num optional
2014-12-01 12:38:38 +01:00
Pieter Wuille
659b554d7b
Make constant initializers independent from num
2014-12-01 12:38:38 +01:00
Pieter Wuille
4285a98722
Move lambda-splitting code to scalar.
...
It's not really an operation on group elements.
2014-11-30 23:38:01 +01:00
Pieter Wuille
6794be6080
Add scalar splitting functions
...
Which currently delegate to the lambda-splitter in group.
2014-11-30 23:38:01 +01:00
Pieter Wuille
d1502eb459
Add secp256k1_scalar_inverse_var which delegates to GMP
2014-11-30 23:38:01 +01:00
Gregory Maxwell
71712b27e5
Switch to C89 comments in prep for making the whole codebase C89 compatible.
...
This should be whitespace/comment only changes and should produce the same
object code.
2014-11-15 07:33:07 -08:00
Gregory Maxwell
a4a43d7543
Reorder static to comply with C99 and switch to the inline macro.
2014-11-12 13:07:55 -08:00
Pieter Wuille
1d52a8b155
Implementations for scalar without data-dependent branches.
2014-11-04 03:01:55 -08:00
Pieter Wuille
501d58f098
Get rid of {num,scalar,ecdsa_sig}_{init,free}
2014-11-03 01:31:04 -08:00
Pieter Wuille
79359302fb
Add unit tests for scalars.
...
Also add a secp256k1_scalar_is_one function.
2014-10-29 02:11:07 -07:00
Pieter Wuille
eca6cdb123
Switch scalar to use get/set 32-byte arrays
2014-10-29 00:40:56 -07:00
Pieter Wuille
a9f5c8b875
Introduce secp256k1_scalar_t for future constant-time mod order operations
2014-10-28 04:33:23 -07:00