Open dogtopus opened 2 years ago
Also for PS4 native auth, it's preferred to use a dedicated core to handle RSA if you want to stay bare metal. Not sure why currently the secondary core is used for LEDs and display while they can be driven with little blocking if the IO to them is async (no bitbang, DMA preferred) and the display isn't doing full screen animations. Just noticed that this is intentional. Then it would be preferred to have an RTOS with SMP support (i.e. FreeRTOS) and correctly set the core affinity for the authenticator thread. Another (technically more challenging) route is to have a custom RSA/SHA256 implementation that supports some form of co-operative scheduling and run it on the second core along with all the modules.
I'm currently adding support for RP2040 to my own DS4 controller library and will be able to post here for more info and auth algorithm example once I got the details ironed out. Meanwhile I do have a DS4 emulator in Python that has native auth capability so feel free to check the code here.
Update: The algorithm is now finished here. Note that it's only the auth part and not how to do it via USB, etc. as those parts are still WIP. You would also need a working mbedtls port (including RNG) for this to work. It should also be possible to make this work on Pico SDK with little modification but I haven't tried this yet.
This is absolute gold. Thanks for sharing.
This is awesome! What needs to be done to get this implemented into GP2040?
Hey @dogtopus ,
Wanted to check in and see how progress on this went.
As a note - This project is no longer maintained. Please check out the Community Edition project. The Community Edition issues section can be found here: https://github.com/OpenStickFoundation/GP2040-CE/
Pretty much just a table listing how to support controllers with authentications.
Basically the best bet is to implement a passthrough support (wide range of controllers covered and user friendly enough). On RP2040 there's a PIO-based USB PHY that's work in progress. MAX3421E is always available as a second option too.