-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add Serpent256 and XChaCha20 encryption #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
1a63e84
feat: compile twofish into WASM
vitonsky 6fb7bdf
fix: improve CTR cipher performance
vitonsky 9e7b859
feat: add Twofish
vitonsky d3b0fa3
perf: avoid a view creation overheads
vitonsky fe149ba
refactor: use sync code, avoid buffers wrapping
vitonsky b1434c9
chore: update random source
vitonsky 1ce24ba
test: verify test vectors
vitonsky 168a9f5
refactor: move twofish into package
vitonsky a6ea33b
chore: update configs
vitonsky 0ae354e
feat: add serpent cipher
vitonsky d1044ba
fix: twofish integrity
vitonsky 65edb3b
test: support wasm imports in vitest
vitonsky cdb1cbe
chore: update ciphers in worker
vitonsky 861c7e2
fix: update buffers usage
vitonsky 5901bb9
chore: update vitest config
vitonsky ae780a8
fix: use buffer instead of Uint8Array
vitonsky 22156ed
test: cover all ciphers
vitonsky 03bfd36
fix: serpent implementation
vitonsky 8072774
test: cover ciphers combinations
vitonsky b73891c
feat: add XChaCha20 cipher
vitonsky 5c11fbd
chore: delete serpent stream
vitonsky 1bd2477
chore: use sodium sumo
vitonsky 8219430
chore: use llm generated code
vitonsky cbdde2a
Revert "chore: use llm generated code"
vitonsky 8d2cb35
chore: add chacha to a ciphers list
vitonsky db26e10
test: look for hex strings
vitonsky cd1e37e
test: verify the XChaCha20 implementation authenticity
vitonsky e8f24be
test: the XChaCha20 verification
vitonsky b9fe7c8
feat: introduce XChaCha20Poly1305
vitonsky 2e0388f
feat: control cipher parameters
vitonsky 3f13862
test: patterns leaks
vitonsky 75dbb99
chore: update code in worker
vitonsky 252bff4
test: use pseudo random & print debug info
vitonsky 508e96a
refactor: use headers with minimal overhead
vitonsky 0aa01ce
fix: join nonce || counter in CTR mode
vitonsky b1453ea
chore: update tests
vitonsky 5ce4518
refactor: provide xor implementation
vitonsky 3746127
chore: add range check for CTR mode
vitonsky ae9ee90
chore: update CTR mode api
vitonsky a849129
refactor: derive keys for twofish
vitonsky 359eea8
feat: keep chunk size in header
vitonsky 0efc692
fix: max bytes counter
vitonsky c0ad398
perf: decrease buffers usage for Serpent
vitonsky 57a8f80
test: convert buffers to strings
vitonsky e69767e
refactor: do not allocate buffer for input
vitonsky 7a0a382
refactor: use buffer reader
vitonsky d5915eb
test: update cipher tests
vitonsky d607050
test: update snapshots
vitonsky eac4064
chore: update tests
vitonsky 483a836
refactor: use AES-CTR
vitonsky 15cb3a0
chore: rename AES cipher
vitonsky b49c84f
feat: use HMAC for integrity
vitonsky e78f872
chore: update integrity header use
vitonsky 742d49f
test: organize tests
vitonsky 95afa98
refactor: unify encryption pipeline configuration
vitonsky 8204ef7
refactor: new encryption pipeline
vitonsky f631cba
feat: cryptography utils in worker
vitonsky baa6fa4
refactor: use Argon2id for key derivation
vitonsky c623de1
build: disable fallback for note imports
vitonsky bf95376
chore: remove twofish from tsconfig
vitonsky 8769fef
chore: update eslint config
vitonsky e5e3780
ci: build twofish
vitonsky 8440469
ci: build Twofish
vitonsky 78d2e7c
ci: use actual UID
vitonsky dddb740
ci: use actual UID
vitonsky 84f5c2f
ci: use actual UID
vitonsky 507857a
ci: use actual UID
vitonsky 821d8cf
ci: use actual UID
vitonsky 8054355
ci: use actual UID
vitonsky 71e3699
chore: update contributing md
vitonsky 3c69bf3
test: add AES spec test
vitonsky 212c85d
test: update tests
vitonsky 10a728f
chore: fix typo
vitonsky 9a3e55e
chore: update deps
vitonsky 6113300
test: use 32 bytes key
vitonsky 4729a64
fix: return full range of pseudo random bytes
vitonsky a950b79
test: update snapshots
vitonsky ac3f01e
chore: remove comments
vitonsky 05cea5e
chore: floor the numbers
vitonsky 5fc254f
fix: padding for serpent encryption
vitonsky 7fb39a4
chore: rename Twofish
vitonsky 30ad606
fix: update var
vitonsky 8fe716c
chore: remove debug print
vitonsky c5ed468
fix(twofish): chunking large buffers
vitonsky 778e001
chore(XChaCha20): wait sodium init
vitonsky a1837a2
chore(XChaCha20): delete load method
vitonsky 05477c7
chore(XChaCha20): use little endian bytes order
vitonsky e41c203
chore(XChaCha20): don't slice
vitonsky 8291a47
test: improve asserts
vitonsky 4cb227f
test: tampered mac
vitonsky 0952a57
chore: reject invalid buffers
vitonsky bdf8349
chore: throw if buffer too small
vitonsky 9e386bb
chore: remove unused code
vitonsky cff4051
chore: do not transfer buffers
vitonsky 33c5efc
fix: use bytes length consistently
vitonsky 25aaf4e
refactor: use bin struct for vault salt
vitonsky a0db6bd
refactor: split salt bytes
vitonsky 28d0b77
fix: slice bytes
vitonsky 8db25b1
chore: delete unnecessary packages
vitonsky d6d4b15
chore: update tsconfig
vitonsky c549768
chore: improve path to URL convertation
vitonsky d58d603
chore: update words
vitonsky 568347f
fix: consistency of twofish wrapper
vitonsky 7585211
chore: add bench for decryption time
vitonsky 205274e
chore: explicitly return undefined
vitonsky 785444a
chore: throw for invalid chunk size
vitonsky 241eb73
test: partial buffer with no padding against CTR mode cipher
vitonsky eddd23e
docs: add license
vitonsky 5fc66c7
chore: use builtin trap in twofish
vitonsky 2a23bd1
build: clean tsdown config
vitonsky ed848ff
test: handle twofish errors
vitonsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Contributing | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| | Tool | Version | Purpose | | ||
| |------|---------|---------| | ||
| | Node.js | 22+ | Runtime & build tooling | | ||
| | Docker | any recent | Building the Twofish WASM module | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| git clone <repo-url> | ||
| cd <repo> | ||
| npm install | ||
| ``` | ||
|
|
||
| ## Building | ||
|
|
||
| Build everything (WASM + TypeScript): | ||
|
|
||
| Build dependencies: | ||
|
|
||
| ```bash | ||
| cd packages/twofish | ||
| npm run build | ||
| ``` | ||
|
|
||
| The WASM build runs inside Docker automatically — no need to install `clang` or `lld` locally. Docker must be running. | ||
|
|
||
| Then build the app: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| ## Linting & Tests | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| npm test | ||
| ``` | ||
|
|
||
| ## CI | ||
|
|
||
| GitHub Actions runs on every push to `master` and on pull requests: | ||
|
|
||
| - **actionlint** — validates GitHub Actions workflow files | ||
| - **tests** — builds, lints, and runs the test suite | ||
| - **CodeQL** — static security analysis | ||
|
|
||
| PRs from forks skip the CodeQL step. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.