Skip to content

Commit beac300

Browse files
authored
test: params from raw (#85)
1 parent 55d0742 commit beac300

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/ctf_picoctf_2019.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,13 @@ fn picoctf_2019_b00tl3grsa2() {
3030
// From picoCTF 2019 / b00tl3gRSA2
3131
// https://play.picoctf.org/practice/challenge/2
3232

33-
let params = Parameters {
34-
e: Integer::from_str("30731415566502435180122312614318295487729550686729940511226444736687062783353215624033761823769102757155829411574455000390828705138242823997675521523899087513360831534511493497536445743181330312735141991297585347004772888815096278263919415426755720011291087031198916825490065591104360547763145232370466531913").unwrap(),
35-
n: Some(Integer::from_str("87788544241211319605948740380288472294452600617043854558636889055368321577570381499097752970288365765657815018148158720277819756283018915366387440245478813120408266319259235982673312103387766357072670785287386600544858574742310633096824820676831952118847866401502023225153958195265729104640256209841926527757").unwrap()),
36-
c: Some(Integer::from_str("27206905408478635182513522137841923392362234234048096616478034417049596738406580742439487737117544490376923254758295246937662022570736634809302909872078226180669403700117127378112550178806195801770428389416767019368765086353819869836280914957569013696606700410415696808111409835638840673606924032534770632734").unwrap()),
37-
..Default::default()
38-
};
33+
let params = Parameters::from_raw(include_str!("raw/picoctf_2019_b00tl3grsa2.txt"));
3934

4035
let solution = run_specific_attacks(&params, &[Arc::new(WienerAttack)]).unwrap();
4136
assert!(solution.pk.is_some());
4237
assert_eq!(
4338
integer_to_string(&solution.m.unwrap()).unwrap(),
44-
"picoCTF{bad_1d3a5_2438125}"
39+
"picoCTF{bad_1d3a5_2152720}"
4540
);
4641
}
4742

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
c: 78394077185972242522366494812194999029111007804513916081388100744678077142246684573709463174914072230588766938274935729449697899122556506361108922139286130431073819269477944903949010409297739704373353086560177410340042335176831160010922826152074048460889509110907225759217407138633733239524781798190577093673
2+
n: 93596195645610503452177719837666902345047461004926714393186384188598288812343005592124086521572864457489909063543756427769917131437307447863586528928496194559057760628385975297585140789577911616474493538014622500120560643072265673362843715324209056486085041020831625385434745566998218712055519575753745124619
3+
e: 1595235523996321655798747471789583440185208568327862733680046250799766370193739982702940394656406146131440688831932739213253542820322450207724280220533900355744553772981019201731036379810734890063829650829319133004906034534031330743611288482822751674556919861911431941749713177767003275664528498846275096193

0 commit comments

Comments
 (0)