Project: https://github.com/WaterJuice/WjCryptLib
Functions look pretty compatible to use for Xenia, and at first glance MD5 would be simple to port over.
Any cryptographic library would be fine (ideally the fastest one for the algorithm), but we should also try to maintain correct contents of the original context structures passed to XeCrypt functions (including endianness), since those aren't just opaque pointers, but rather data that games can use for their own crypto-related routines. Sometimes it may be even better to manually implement those if we can't easily translate the context into what the library needs.
I have done extensive reverse engineering on a lot of the kernel crypto functions, implemented some of the proprietary algorithms, and documented several structures -- is there a list of the functions / structs that Xenia is missing that I could fill in?
Really should have posted about this earlier, but I did make a start on an XeCrypt replacement library a few months ago: https://github.com/emoose/ExCrypt
It's mostly based on stuff already inside Xenia though, so that they could easily be used in other projects etc, but there are a couple extra things in there Xenia is currently missing IIRC.
I ended up running into endian issues though so wouldn't count it as usable yet... been meaning to dig out my 360 to compare things & get it fixed up, maybe I'll take another look at it soon, anyone is welcome to improve on it though, or take anything you like from it.
@acabey that's great! If you search in https://github.com/xenia-project/xenia/blob/master/src/xenia/kernel/xboxkrnl/xboxkrnl_table.inc for XeCrypt/XeKeys you can see pretty much all the kernel ones Xenia needs.
Some of them have implementations in https://github.com/xenia-project/xenia/blob/master/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc already, but there's a ton missing that we don't have anything for atm...
If you want to know which are higher priority I guess you'd need to search through the logs in https://github.com/xenia-project/game-compatibility/issues for what shows up most...
There's also a bot on Discord that parses peoples logs and spits out the missing functions etc, maybe that'd be easier to look through.
Most helpful comment
Really should have posted about this earlier, but I did make a start on an XeCrypt replacement library a few months ago: https://github.com/emoose/ExCrypt
It's mostly based on stuff already inside Xenia though, so that they could easily be used in other projects etc, but there are a couple extra things in there Xenia is currently missing IIRC.
I ended up running into endian issues though so wouldn't count it as usable yet... been meaning to dig out my 360 to compare things & get it fixed up, maybe I'll take another look at it soon, anyone is welcome to improve on it though, or take anything you like from it.
@acabey that's great! If you search in https://github.com/xenia-project/xenia/blob/master/src/xenia/kernel/xboxkrnl/xboxkrnl_table.inc for XeCrypt/XeKeys you can see pretty much all the kernel ones Xenia needs.
Some of them have implementations in https://github.com/xenia-project/xenia/blob/master/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc already, but there's a ton missing that we don't have anything for atm...
If you want to know which are higher priority I guess you'd need to search through the logs in https://github.com/xenia-project/game-compatibility/issues for what shows up most...
There's also a bot on Discord that parses peoples logs and spits out the missing functions etc, maybe that'd be easier to look through.