SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.39k stars 3.18k forks source link

SHA-1 and SHA-256 x86 #23949

Open MarekKnapek opened 5 months ago

MarekKnapek commented 5 months ago

Hi, my name is Marek and I'm new here. I'm C++ and C developer. I have been watching Serenity development for a while. And today I decided to join. I have already developed x86 specific acceleration for various cryptographic functions such as SHA-1, SHA-256, SHA-512 and AES for my own project. I would like to add it to Serenity. First question: Would you like it? Second question: If yes, how should I do it? I need to add two tests: One is compile-time test for supported architecture (i386 and amd64) and for supported compilers (GCC >= 11.1 only so far). The second is run-time test for detecting presence of sha/aes instructions on processor and register saving by the OS on context switch. So... is there already some kind of infrastructure / best practices around cpuid?

My code is available at: https://github.com/MarekKnapek/serenity/commits/SHA1x86/

MarekKnapek commented 5 months ago

Added SHA-256 on different branch: https://github.com/MarekKnapek/serenity/commits/SHAx86/

MarekKnapek commented 5 months ago

Created pull request: https://github.com/SerenityOS/serenity/pull/23958