eth-sig-util icon indicating copy to clipboard operation
eth-sig-util copied to clipboard

test(encryption): add backwards-compatibility-test for encrypt/decrypt

Open legobeat opened this issue 1 year ago • 1 comments

Encryption in this library is historically using tweetnacl and tweetnacl-util as encryption libraries. tweetnacl-util was replaced with @scure/base in #358 and tweetnacl is also due for removal.

This adds a snapshot of encryption.ts as test-legacy-encryption.ts, and adds compatibility tests in both directions to ensure that new versions of the code can decrypt messages produced by the old version and vice-versa.

It does this by wrapping the entire existing encryption-test-suite and injecting the functions under test.


Note for reviewers: Most of the diff in encryption.test.ts is indentation, which can be ignored by git diff -w).

legobeat avatar May 01 '24 07:05 legobeat

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] None 0 8.14 kB dchest

View full report↗︎

socket-security[bot] avatar May 01 '24 07:05 socket-security[bot]