block-ciphers icon indicating copy to clipboard operation
block-ciphers copied to clipboard

Add implementation of Speck

Open jvdsn opened this issue 3 years ago • 8 comments
trafficstars

Based on https://eprint.iacr.org/2013/404.pdf Using testvectors from Appendix C of the aforementioned paper.

Notes:

  • I implemented this based on the cipher v0.4 branch, so this should only be merged after that branch is merged.
  • The crate name is currently speck, however, there's already a crate with that name on crates.io, so I think we need to come up with a different name? I've never published on crates.io before.
  • The actual code itself uses a macro system similar to AES, with the code inside the macro definition based on SM4.
  • I'm not very experienced in Rust, so there might be some things that could be done better. Please let me know!

This partially solves #1.

jvdsn avatar Jan 22 '22 19:01 jvdsn

With cipher v0.4 being released, this is a bit more ready for review, but of course the crate name issue remains.

jvdsn avatar Feb 10 '22 20:02 jvdsn

I've registered speck-cipher, so we can use it for now.

newpavlov avatar Feb 10 '22 21:02 newpavlov

I can ask the owners of the current speck crate if they'd be willing to give it to us. It's worked before!

tarcieri avatar Feb 10 '22 21:02 tarcieri

I can ask the owners of the current speck crate if they'd be willing to give it to us. It's worked before!

Perhaps that could be worth a shot, the crate on crates.io doesn't seem to be very active. If that doesn't work out, I can prepare a commit to change the crate names in the code/README/...

jvdsn avatar Feb 10 '22 21:02 jvdsn

I can ask the owners of the current speck crate if they'd be willing to give it to us.

One problem with speck is that it's a post-1.0 crate. So making a breaking cipher change would mean that we would have to publish speck v2.0.

newpavlov avatar Feb 10 '22 21:02 newpavlov

@newpavlov if the existing authors are OK with it, we could yank the existing post-1.0 releases and use 0.x releases while our API is unstable, and when we're ready to stabilize, release 2.0.

It doesn't have many downloads (2622) and only one downstream dependency (speck-cbc) which itself has no downstream dependencies, so I don't imagine it will be an issue. If anyone complains, we can re-release the original crate under a new name they can switch to.

tarcieri avatar Feb 10 '22 21:02 tarcieri

I added some configuration for a minimal-versions action.

jvdsn avatar Feb 17 '22 23:02 jvdsn

FYI: I reached out to the owners of the speck crate and did not hear back

tarcieri avatar Mar 01 '22 16:03 tarcieri