Looking at the decompiled secure_enclave.ko, we find
// read back to struct
iVar1 = enclave_read(auStack552,param_3,param_3,0);
...
%% ROFdenoise | |
% | |
% Copyright (c) 2022, Carl Löndahl & Philippe Magiera | |
% | |
% Redistribution and use in source and binary forms, with or without | |
% modification, are permitted provided that the following conditions are met: | |
% | |
% Redistributions of source code must retain the above copyright notice, | |
% this list of conditions and the following disclaimer. | |
% Redistributions in binary form must reproduce the above copyright notice, |
from pwn import * | |
L, zz, m = 1024, 15, 3 | |
def H(params, msg, u): | |
K, m = params | |
r, z = K.characteristic(), K.gens()[0] | |
h = 0 | |
while msg > 0: | |
h *= z | |
h += msg % r |
import os | |
import math | |
import random | |
import multiprocessing | |
THREADS = multiprocessing.cpu_count() | |
def close_factor_worker(n, delta, ub, ret): |
import math | |
poly = 0xa195150d15*2+1 | |
degree = int(math.log(poly)/math.log(2)) | |
f = (1 << degree) | |
def multiply(a, b, poly): | |
r = 0 | |
for i in range(64): | |
if ((a & (1 << i)) != 0): |
# https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/coppersmith.sage | |
length_N = 2048 # size of the modulus | |
Kbits = 8*30 # size of the root | |
e = 7 | |
n = 17128253199894018356121352721813384810490073007249104944917185889284458477972764510189878223087898232323989051389196334498213309997968573900259909767276527308390944053199244416237135384010089907191097552095732629493007104656712229046898881071816439581052398074559706748835744846278126604658780761748930367026870270721107608579738966885369180506986732756678936607083412698682076417247965156736007257325263626024309893180725648019322055002425052139312236077136949139163190290260407572716784894091812931974782646175099495402465049210759703810960600180113684855659892187079557217272929145318759442388534032426335197492209 | |
# message with X:s replaced with \x00 | |
m2 = 1151872456563255756988757297902826422129305487484630920652043694187082162911556659892050210474688381420250518430998359312196354764596383582917689440249772602018397427821248590885298739719055223407805 |