File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget"]
19
19
bitcoin = " 0.13"
20
20
rust-crypto = " 0.2"
21
21
rand = " 0.4"
22
- secp256k1 = { git = " https://github.com/rust-bitcoin/rust-secp256k1 " , branch = " master " }
22
+ secp256k1 = " 0.9 "
23
23
24
24
[build-dependencies ]
25
25
gcc = " 0.3"
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ honggfuzz_fuzz = ["honggfuzz"]
18
18
[dependencies ]
19
19
lightning = { path = " .." , features = [" fuzztarget" ] }
20
20
bitcoin = { version = " 0.13" , features = [" fuzztarget" ] }
21
- secp256k1 = { git = " https://github.com/rust-bitcoin/rust-secp256k1 " , branch = " master " , features =[" fuzztarget" ]}
21
+ secp256k1 = { version = " 0.9 " , features =[" fuzztarget" ] }
22
22
rust-crypto = " 0.2"
23
23
honggfuzz = { version = " 0.5" , optional = true }
24
24
afl = { version = " 0.3" , optional = true }
Original file line number Diff line number Diff line change @@ -4,33 +4,31 @@ pub use crypto::sha2::Sha256;
4
4
#[ cfg( feature = "fuzztarget" ) ]
5
5
mod fuzzy_sha {
6
6
use crypto:: digest:: Digest ;
7
- use crypto:: sha2;
8
7
9
- #[ derive( Clone , Copy ) ]
10
8
pub struct Sha256 {
11
- state : sha2 :: Sha256 ,
9
+ state : u8 ,
12
10
}
13
11
14
12
impl Sha256 {
15
13
pub fn new ( ) -> Sha256 {
16
14
Sha256 {
17
- state : sha2 :: Sha256 :: new ( ) ,
15
+ state : 0 ,
18
16
}
19
17
}
20
18
}
21
19
22
20
impl Digest for Sha256 {
23
21
fn result ( & mut self , data : & mut [ u8 ] ) {
24
- self . state . result ( data ) ;
22
+ data [ 0 ] = self . state ;
25
23
for i in 1 ..32 {
26
24
data[ i] = 0 ;
27
25
}
28
26
}
29
27
30
- fn input ( & mut self , data : & [ u8 ] ) { self . state . input ( data ) ; }
31
- fn reset ( & mut self ) { self . state . reset ( ) ; }
32
- fn output_bits ( & self ) -> usize { self . state . output_bits ( ) }
33
- fn block_size ( & self ) -> usize { self . state . block_size ( ) }
28
+ fn input ( & mut self , data : & [ u8 ] ) { for i in data { self . state ^= i ; } }
29
+ fn reset ( & mut self ) { self . state = 0 ; }
30
+ fn output_bits ( & self ) -> usize { 256 }
31
+ fn block_size ( & self ) -> usize { 64 }
34
32
}
35
33
}
36
34
#[ cfg( feature = "fuzztarget" ) ]
You can’t perform that action at this time.
0 commit comments