Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Writing an emulator for a slightly unusual abstract FSM

Name: Anonymous 2016-05-12 15:20

what would be a relatively hassle-free way of writing an elegant, intuitive code that emulates a finite state machine (no jumps or conditionals) with a self-modifying instruction set (or maybe just two instruction sets: one for modifying data, other for modifying the first instruction set)? I don't care about performance right now (I doubt it will get to the stage when I need to care about that but if it does, some fuckery with C function pointers will be inevitable; right now I care about readability and being able to prototype quickly) so functional is OK but I'm thinking of instructions having four-bit length and I'm not sure how good purefuncs are at handling that

Name: Anonymous 2016-05-16 18:44

>>31
You need to be very particular with your instruction selection to retain reversibility. Things like bit shifting can be irreversible as well.

the only shifting I'm using is rotation which is reversible

Equal execution time is often required of encryption algorithms to avoid timing attacks.

finally, someone with a brain

However, OP is doing this completely boneheadedly. What should be done is to ensure that the two branches that a decision can make result in the same execution time, with padding on the slower branch, not trying for equal execution time of every single instruction.

that's what I'm talking about, 'instruction' in this case refers to the instruction on the abstract machine, not on a CPU on which it's emulated.

Plus, since she doesn't have any branches anyway, it's all moot with regards to timing attacks.

timing is there so you can't identify which instruction is being executed. that's because 'program' stream is key and 'data' stream is plaintext.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List