I am looking at Luigi's code here. When it comes to encrypting the seed, field 9 on xmr.llcoins.net, there is a comment about various ways that have been implemented for doing this. It mentions the use of Keccak at some point, and then 'CN XOR' and 'CN add'. Which one is the method currently being used in the reference wallet?
Also, contrary to the functions used to deriving the seed and checksum, the code for the slow-hash and slow-hash-worker are quite undecipherable to me (assuming I am looking at the right code).
Could someone help me to understand what is going on and to translate that into python code?
cn_slow_hash
. There's a pure python version at github.com/monero-ecosystem/slow-hash but you're probably safer using one of the many bindings instead. You also need scalar addition/subtractiion from a ed25515 library/module.