Commit Graph

210 Commits

Author SHA1 Message Date
Andrew Poelstra eddfe03dbc
Merge pull request #151 from elichai/2019-08-Cptr-null
Explicit checks for ZST + null fallbacks
2019-08-21 23:03:30 +00:00
Elichai Turkel d7461e4cdc
Add zst tests and some other parsing tests 2019-08-21 18:06:02 -04:00
Elichai Turkel ddb8e4fdf2
Explicit checks for empty slices 2019-08-21 13:09:36 -04:00
Elichai Turkel b7e20c5b12
Changed all as_*ptr() to the safer CPtr trait 2019-08-21 13:09:36 -04:00
Elichai Turkel 66ab70f991
Added a C Ptr trait that returns a null pointer for ZSTs 2019-08-21 13:09:20 -04:00
Tim Ruffing 255d1ddd60 Remove TODOs for ffi functions for setting secp256k1 callbacks
We would not want to use these functions internally because we rely on
USE_EXTERNAL_DEFAULT_CALLBACKS to provide the callbacks at link time,
see f7a4a7ef57. Moreover, we would not
want to export the functions either.
2019-08-20 14:47:33 +02:00
Elichai Turkel 8e701b75b2
Replacing usage of the unsafe `blank` function to the `new` function
Signed-off-by: Elichai Turkel <elichai.turkel@gmail.com>
2019-08-16 14:15:31 -04:00
Elichai Turkel 389e1e2449
Removing usage of `mem::uninitialized()` and deprecating the `blank()` functions
Signed-off-by: Elichai Turkel <elichai.turkel@gmail.com>
2019-08-16 14:15:27 -04:00
Elichai Turkel 16fc4ee3fc Fixed the counter Rng 2019-08-13 10:41:39 -04:00
Steven Roose 0f25474805
Implement hex human-readable serde for PublicKey 2019-07-23 17:50:56 +02:00
Steven Roose ccac3ead25
Implement fmt::LowerHex for SecretKey and PublicKey 2019-07-23 17:50:54 +02:00
Elichai Turkel 7356705b61 Added a test for create/destroy functions 2019-07-14 16:35:51 -04:00
Elichai Turkel 75784ec26f Implemented context create/destroy in rust 2019-07-14 16:35:47 -04:00
Elichai Turkel 96ca40faed
Exposed generic functions to create the Context 2019-07-04 21:36:32 -04:00
Elichai Turkel 49f0cc1c46
Updated the fuzzing dummy functions 2019-07-04 19:13:26 -04:00
Elichai Turkel 811e8d24e9
Removed context_create/destroy/clone and scratch_create/destroy/clone functions. 2019-07-04 19:09:04 -04:00
Elichai Turkel 9186f0223a
Added preallocation size functions and added a test for the preallocation 2019-07-04 18:40:08 -04:00
Elichai Turkel 1c0ae7d4ba
Added structs and functions for manual allocation 2019-07-04 18:40:07 -04:00
Elichai Turkel b4b52a9858
Moved the context specific traits/enums into a separate file with `std` gate 2019-07-04 18:40:07 -04:00
Elichai Turkel 5f93474512
Added the preallocated FFI 2019-07-04 18:40:04 -04:00
Elichai Turkel 68c5c5edbf
implemented strlen to deref the callback message 2019-07-03 17:50:16 -04:00
Elichai Turkel 8022757681
Added a c_char implementation 2019-07-03 17:48:35 -04:00
Elichai Turkel f7a4a7ef57
Added manual external callbacks that panics 2019-07-03 17:48:35 -04:00
Jonas Nick 0e6ff34009 Fix imports when using recovery with fuzztarget feature 2019-05-29 00:02:11 +00:00
Elichai Turkel be457afdae
Removed ffi call from Display implementation 2019-05-21 22:05:18 +03:00
Andrew Poelstra 0bf88fe444
Merge pull request #109 from jonasnick/human-sigs
Add human readable serialization to Signatures
2019-05-21 17:50:41 +00:00
Jonas Nick ebf50df1d1 Add human readable serialization to Signatures 2019-05-21 10:34:18 +00:00
Jonas Nick 28934ab5a7 Only display existing signature bytes 2019-05-21 10:22:05 +00:00
Jonas Nick 16da1a854c Move recovery ffi into recovery module and feature gate C-secp recovery module 2019-05-21 07:52:08 +00:00
Jonas Nick c7eecd159e Feature gate recovery module 2019-05-21 07:02:11 +00:00
Jonas Nick 264b368ee0 Move recovery to its own module 2019-05-20 19:11:59 +00:00
Jonas Nick 3825ed35a7 Add human readable serialization and deserialization to Secret Key 2019-05-14 11:15:18 +00:00
Tim Ruffing ab4320f8cc
Merge pull request #100 from elichai/master
Add no-std support
2019-05-10 23:32:52 +02:00
Elichai Turkel dfcf74f9d0
Added a new struct for the DER serialized signature 2019-05-11 00:11:42 +03:00
Andrew Poelstra 90faf434c9
Merge pull request #104 from alekseysidorov/fix_rand
Fix `Rand` trait bounds.
2019-05-01 01:47:43 +00:00
Elichai Turkel 312b9a55fc
Added Error::description copied c_void impl from core::ffi::c_void 2019-04-30 22:07:27 +03:00
Jonas Nick 91c43e7320 Add as_mut_ptr to PublicKey 2019-04-16 18:48:24 +00:00
Aleksei Sidorov 2536c5a3c4 Fix rand trait bounds. 2019-04-16 16:35:33 +03:00
Elichai Turkel e98975a1c0
Added backwards support without the crate keyword 2019-04-14 12:09:43 +03:00
Elichai Turkel ab8066eb1a
Replaced the std::os::raw c types with types.rs 2019-04-14 12:09:42 +03:00
Elichai Turkel 11ce86681f
Replaced std with core, and made std::error::Error optional through feature 2019-04-14 12:09:36 +03:00
Jonas Nick 6eaacb19c5 Add raw context getter to Secp256k1 struct 2019-03-01 19:39:55 +00:00
François Garillot a8a3afe8db
Fix clippy errors
Changes include cargo-fix generated, Default impls
2019-02-25 20:12:25 -08:00
François Garillot bafef68c56
Bumps rand to 0.6.3 & associated updates 2019-02-25 20:09:43 -08:00
Matt Corallo f90e9f3454 Stop checking context flags for secp256k1_ecdh as its not required 2019-01-16 16:02:24 -05:00
Matt Corallo a74cbb6781 Sync fuzztarget combine with tweak_add since real functions do that
Some new fuzz tests I was writing ended up failing because two
nodes came up with different keys because adding public keys and
adding a tweak to a private key and multiplying by the generator
should get the same thing.
2019-01-08 16:12:40 -05:00
Pierre Krieger 9c45944a5f
Remove dependency on libc 2018-12-27 14:39:54 +01:00
Tim Ruffing b470f70e90
Merge pull request #57 from rust-bitcoin/2018-08-no-index
remove `ops::Index` impls for `Signature`
2018-12-03 14:27:08 +01:00
Andrew Poelstra e5a02bd9a0 add `ThirtyTwoByteHash` hash trait which can be implemented for easier conversion of things to `Message`s 2018-11-10 13:12:10 +00:00
Andrew Poelstra 1f4a4c11a3 change add_*_assign and mul_*_assign to use a byteslice as a tweak, rather than a `SecretKey`
This makes more conceptual sense and does not add any new error paths, since even
valid `SecretKey`s were able to be invalid tweaks.
2018-11-10 13:08:18 +00:00