pluto / ronkathon

Cryptography Educational Foundations
https://pluto.xyz/blog/ronkathon-learn-cryptography-from-first-principles
Apache License 2.0
191 stars 23 forks source link

Add AES-GCM(includes GHASH) #157

Closed mrdaybird closed 2 months ago

mrdaybird commented 2 months ago

closes #140 (Bounty: AES-GCM)

Worklist:

Notes:

  1. Made some changes to already existing CTR(ctr.rs) implementation, which were required for GCM. The GCM spec requires a nonce of 96-bit and counter size of 32-bit (=> total of 128-bit), but the previous CTR implementation used a 50-50 split of block size for nonce and counter.
  2. Removed an "assert" in AES implementation which failed when encrypting a string of zeros.
mrdaybird commented 2 months ago

@0xJepsen @brunny-eth I think this PR is ready for review!

There are a couple of more things, like updating the CTR section in README and adding a faster polynomial hash algorithm, but that can be done in another PR, this PR is already too big.

It was a fun week learning Rust and playing with bits! :smile:

0xJepsen commented 2 months ago

If you can push up a change so that the lint passes I am happy to merge this! Like you mentioned i think a little bit of love on the readme would be good. I spent some time drawing some diagrams in ascii for GCTR here, as well as for GHASH here if you like you can grab them and put them where you think they fit if they are helpful. Also adding a link to the root readme and linking to the one you wrote would be a nice touch!

Thanks for everything! After some final touches on docs we @brunny-eth can work with you on getting you the bounty!

brunny-eth commented 1 month ago

hey @mrdaybird -- great work here, we're really happy that you chose to contribute to our project!

we're going to be awarding you with a $750 bounty for the work you've done here. Please share your preferred contact info (e-mail, telegram, etc.) here so I can reach out and coordinate payment

thanks again for your contributions! Hope you decide to stick around 😃

mrdaybird commented 1 month ago

hey @mrdaybird -- great work here, we're really happy that you chose to contribute to our project! we're going to be awarding you with a $750 bounty for the work you've done here

@brunny-eth woah! awesome!

you can email me at pathakvaibhav@protonmail.com

Hope you decide to stick around 😃

Definitely! this is an amazing initiative! I learned a lot from this project, and I am sure that I will be using this to learn about cryptography in the future.

EDIT: I have pinged you on telegram, just in case!