oasisprotocol / deoxysii-js

JavaScript Deoxys-II-256-128
https://www.npmjs.com/package/@oasisprotocol/deoxysii
MIT License
6 stars 1 forks source link

rewrite in typescript #12

Closed nhynes closed 4 months ago

CedarMist commented 4 months ago

You will be pleased to know my PR has re-written this library typescript, updated all the tooling, and reduces the bundled size for both CommonJS and ESM (with or without tree shaking).

minified + gzip it's about 3.5kb with no other dependencies, and it has a nice README too.

nhynes commented 4 months ago

I am pleased, thank you! I will probably update the vendored dependency at some point. I'm using aes-gcm-siv these days since it's portable and deoxysii hasn't really seemed to catch on, but I am very glad to be able to close this almost five year old issue 😄

CedarMist commented 4 months ago

Unfortunately AES-GCM-SIV isn't supported by the WebCrypto Subtle API :(

So regardless of if we use Deoxys-II or AES-GCM-SIV as the MR-AEAD algo it's going to end up as being a custom implementation.

Have added ticket #39 for porting to WebAssembly, I'm sure in another 5 years somebody will get round to doing that lol.

nhynes commented 4 months ago

Unfortunately AES-GCM-SIV isn't supported by the WebCrypto Subtle API

It's not, but it is part of the @noble/ciphers suite, which is pretty good and well maintained!

CedarMist commented 4 months ago

It seems the @noble/ciphers implementation of AES-GCM-SIV is pure JS, whereas the micro-aes-gcm version uses webcrypto.subtle behind the scenes where possible (aside from the tag computation).

What about AEAD_XCHACHA20_SIV_HMAC_SHA256 ?