Skip to content

Commit 8cf1aa9

Browse files
authored
Merge pull request #53 from 3for/master
outdated fuzzers code
2 parents 3513a12 + ead8cb6 commit 8cf1aa9

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

fuzz/fuzzers/conditional_assign_i128.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![no_main]
2-
#![feature(i128_type)]
32

43
#[macro_use]
54
extern crate libfuzzer_sys;
@@ -8,7 +7,7 @@ extern crate core;
87

98
use core::intrinsics::transmute;
109

11-
use subtle::ConditionallyAssignable;
10+
use subtle::ConditionallySelectable;
1211

1312
fuzz_target!(|data: &[u8]| {
1413
let chunk_size: usize = 16;
@@ -26,10 +25,10 @@ fuzz_target!(|data: &[u8]| {
2625
bytes[8], bytes[9], bytes[10], bytes[11],
2726
bytes[12], bytes[13], bytes[14], bytes[15]]);
2827

29-
x.conditional_assign(&y, 0);
28+
x.conditional_assign(&y, 0.into());
3029
assert_eq!(x, 0);
3130

32-
x.conditional_assign(&y, 1);
31+
x.conditional_assign(&y, 1.into());
3332
assert_eq!(x, y);
3433
}
3534
}

fuzz/fuzzers/conditional_assign_i8.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ extern crate core;
77

88
use core::intrinsics::transmute;
99

10-
use subtle::ConditionallyAssignable;
10+
use subtle::ConditionallySelectable;
1111

1212
fuzz_target!(|data: &[u8]| {
1313
for y in data.iter() {
1414
unsafe {
1515
let mut x: i8 = 0;
1616
let y: i8 = transmute::<u8, i8>(*y);
1717

18-
x.conditional_assign(&y, 0);
18+
x.conditional_assign(&y, 0.into());
1919
assert_eq!(x, 0);
2020

21-
x.conditional_assign(&y, 1);
21+
x.conditional_assign(&y, 1.into());
2222
assert_eq!(x, y);
2323
}
2424
}

fuzz/fuzzers/conditional_assign_u16.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate core;
77

88
use core::intrinsics::transmute;
99

10-
use subtle::ConditionallyAssignable;
10+
use subtle::ConditionallySelectable;
1111

1212
fuzz_target!(|data: &[u8]| {
1313
let chunk_size: usize = 2;
@@ -21,10 +21,10 @@ fuzz_target!(|data: &[u8]| {
2121
let mut x: u16 = 0;
2222
let y: u16 = transmute::<[u8; 2], u16>([bytes[0], bytes[1]]);
2323

24-
x.conditional_assign(&y, 0);
24+
x.conditional_assign(&y, 0.into());
2525
assert_eq!(x, 0);
2626

27-
x.conditional_assign(&y, 1);
27+
x.conditional_assign(&y, 1.into());
2828
assert_eq!(x, y);
2929
}
3030
}

fuzz/fuzzers/conditional_assign_u8.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ extern crate libfuzzer_sys;
55
extern crate subtle;
66
extern crate core;
77

8-
use subtle::ConditionallyAssignable;
8+
use subtle::ConditionallySelectable;
99

1010
fuzz_target!(|data: &[u8]| {
1111
for y in data.iter() {
1212
let mut x: u8 = 0;
1313

14-
x.conditional_assign(y, 0);
14+
x.conditional_assign(y, 0.into());
1515
assert_eq!(x, 0);
1616

17-
x.conditional_assign(y, 1);
17+
x.conditional_assign(y, 1.into());
1818
assert_eq!(x, *y);
1919
}
2020
});

0 commit comments

Comments
 (0)