File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed
Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,7 @@ features-check:
4747 # required wasm32-unknown-unknown target
4848 $(Change_Work_Path ) && cargo build --features wasm-timer,unstable --no-default-features --target=wasm32-unknown-unknown
4949 $(Change_Work_Path ) && cargo build --features wasm-timer,unstable,secio-async-trait --no-default-features --target=wasm32-unknown-unknown
50- # required wasm32-wasip1 target
51- $(Change_Work_Path ) && cargo build --features wasm-timer,unstable --no-default-features --target=wasm32-wasip1
52- $(Change_Work_Path ) && cargo build --features wasm-timer,unstable,secio-async-trait --no-default-features --target=wasm32-wasip1
50+
5351bench_p2p :
5452 cd bench && cargo run --release
5553
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ edition = "2021"
99cargo-fuzz = true
1010
1111[dependencies ]
12- libfuzzer-sys = " 0.3 "
12+ libfuzzer-sys = " 0.4 "
1313tentacle-secio = { path = " ../secio" }
1414tokio-yamux = { path = " ../yamux" }
1515rand = " 0.8"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const WS: u32 = 0x01dd;
2020const WSS : u32 = 0x01de ;
2121const MEMORY : u32 = 0x0309 ;
2222
23- const SHA256_CODE : u16 = 0x12 ;
23+ const SHA256_CODE : u64 = 0x12 ;
2424const SHA256_SIZE : u8 = 32 ;
2525
2626/// `Protocol` describes all possible multiaddress protocols.
@@ -276,7 +276,7 @@ impl<'a> From<Ipv6Addr> for Protocol<'a> {
276276}
277277
278278fn check_p2p ( data : & [ u8 ] ) -> Result < ( ) , Error > {
279- let ( code, bytes) = unsigned_varint:: decode:: u16 ( data) ?;
279+ let ( code, bytes) = unsigned_varint:: decode:: u64 ( data) ?;
280280
281281 if code != SHA256_CODE {
282282 return Err ( Error :: UnknownHash ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use unsigned_varint::{decode, encode};
66
77use crate :: handshake:: handshake_struct:: PublicKey ;
88
9- const SHA256_CODE : u16 = 0x12 ;
9+ const SHA256_CODE : u64 = 0x12 ;
1010const SHA256_SIZE : u8 = 32 ;
1111
1212/// Identifier of a peer of the network
@@ -31,7 +31,7 @@ impl PeerId {
3131 return Err ( Error :: Empty ) ;
3232 }
3333
34- let ( code, bytes) = decode:: u16 ( & data) . map_err ( |_| Error :: InvalidData ) ?;
34+ let ( code, bytes) = decode:: u64 ( & data) . map_err ( |_| Error :: InvalidData ) ?;
3535
3636 if code != SHA256_CODE {
3737 return Err ( Error :: NotSupportHashCode ) ;
@@ -57,8 +57,8 @@ impl PeerId {
5757
5858 /// Return `PeerId` which used hashed seed as inner.
5959 fn from_seed ( seed : & [ u8 ] ) -> Self {
60- let mut buf = encode:: u16_buffer ( ) ;
61- let code = encode:: u16 ( SHA256_CODE , & mut buf) ;
60+ let mut buf = encode:: u64_buffer ( ) ;
61+ let code = encode:: u64 ( SHA256_CODE , & mut buf) ;
6262
6363 let header_len = code. len ( ) + 1 ;
6464
You can’t perform that action at this time.
0 commit comments