Skip to content

Instantly share code, notes, and snippets.

View rharael's full-sized avatar
🏠
Working from home

Wendel Rharael rharael

🏠
Working from home
View GitHub Profile
@david-a-perez
david-a-perez / fastest_day6_part2.rs
Last active October 17, 2025 06:38
Advent of Code 2023 Day 6 Optimizations
// time: [1.8843 µs 1.8897 µs 1.8955 µs]
pub fn original(input: &[u8]) -> Option<usize> {
let mut idx = 0;
'outer: while idx + 13 < input.len() {
let mut state = 0;
for (next_idx, byte) in input[idx..idx + 14].iter().enumerate().rev() {
let bit_idx = byte % 32;
if state & (1 << bit_idx) != 0 {
idx += next_idx + 1;
continue 'outer;
@VAD3R-95
VAD3R-95 / hastad_attack(rsa).py
Last active February 24, 2025 02:29
RSA attacks: factorisation, weiner, common modulus
import gmpy2
import binascii
e = 3
c1 = gmpy2.mpz("")
n1 = gmpy2.mpz("")
c2 = gmpy2.mpz("")
n2 = gmpy2.mpz("")
c3 = gmpy2.mpz("")
n3 = gmpy2.mpz("")