Skip to content
Merged
Show file tree
Hide file tree
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 Mar 27, 2026
6fb7bdf
fix: improve CTR cipher performance
vitonsky Mar 27, 2026
9e7b859
feat: add Twofish
vitonsky Mar 27, 2026
d3b0fa3
perf: avoid a view creation overheads
vitonsky Mar 28, 2026
fe149ba
refactor: use sync code, avoid buffers wrapping
vitonsky Mar 28, 2026
b1434c9
chore: update random source
vitonsky Mar 28, 2026
1ce24ba
test: verify test vectors
vitonsky Mar 28, 2026
168a9f5
refactor: move twofish into package
vitonsky Mar 30, 2026
a6ea33b
chore: update configs
vitonsky Mar 30, 2026
0ae354e
feat: add serpent cipher
vitonsky Mar 30, 2026
d1044ba
fix: twofish integrity
vitonsky Mar 30, 2026
65edb3b
test: support wasm imports in vitest
vitonsky Mar 30, 2026
cdb1cbe
chore: update ciphers in worker
vitonsky Mar 30, 2026
861c7e2
fix: update buffers usage
vitonsky Mar 30, 2026
5901bb9
chore: update vitest config
vitonsky Mar 30, 2026
ae780a8
fix: use buffer instead of Uint8Array
vitonsky Mar 30, 2026
22156ed
test: cover all ciphers
vitonsky Mar 30, 2026
03bfd36
fix: serpent implementation
vitonsky Mar 30, 2026
8072774
test: cover ciphers combinations
vitonsky Mar 30, 2026
b73891c
feat: add XChaCha20 cipher
vitonsky Mar 31, 2026
5c11fbd
chore: delete serpent stream
vitonsky Mar 31, 2026
1bd2477
chore: use sodium sumo
vitonsky Apr 1, 2026
8219430
chore: use llm generated code
vitonsky Apr 1, 2026
cbdde2a
Revert "chore: use llm generated code"
vitonsky Apr 1, 2026
8d2cb35
chore: add chacha to a ciphers list
vitonsky Apr 1, 2026
db26e10
test: look for hex strings
vitonsky Apr 1, 2026
cd1e37e
test: verify the XChaCha20 implementation authenticity
vitonsky Apr 1, 2026
e8f24be
test: the XChaCha20 verification
vitonsky Apr 2, 2026
b9fe7c8
feat: introduce XChaCha20Poly1305
vitonsky Apr 2, 2026
2e0388f
feat: control cipher parameters
vitonsky Apr 2, 2026
3f13862
test: patterns leaks
vitonsky Apr 2, 2026
75dbb99
chore: update code in worker
vitonsky Apr 3, 2026
252bff4
test: use pseudo random & print debug info
vitonsky Apr 3, 2026
508e96a
refactor: use headers with minimal overhead
vitonsky Apr 3, 2026
0aa01ce
fix: join nonce || counter in CTR mode
vitonsky Apr 3, 2026
b1453ea
chore: update tests
vitonsky Apr 3, 2026
5ce4518
refactor: provide xor implementation
vitonsky Apr 3, 2026
3746127
chore: add range check for CTR mode
vitonsky Apr 3, 2026
ae9ee90
chore: update CTR mode api
vitonsky Apr 4, 2026
a849129
refactor: derive keys for twofish
vitonsky Apr 4, 2026
359eea8
feat: keep chunk size in header
vitonsky Apr 4, 2026
0efc692
fix: max bytes counter
vitonsky Apr 4, 2026
c0ad398
perf: decrease buffers usage for Serpent
vitonsky Apr 4, 2026
57a8f80
test: convert buffers to strings
vitonsky Apr 4, 2026
e69767e
refactor: do not allocate buffer for input
vitonsky Apr 4, 2026
7a0a382
refactor: use buffer reader
vitonsky Apr 4, 2026
d5915eb
test: update cipher tests
vitonsky Apr 4, 2026
d607050
test: update snapshots
vitonsky Apr 4, 2026
eac4064
chore: update tests
vitonsky Apr 4, 2026
483a836
refactor: use AES-CTR
vitonsky Apr 4, 2026
15cb3a0
chore: rename AES cipher
vitonsky Apr 4, 2026
b49c84f
feat: use HMAC for integrity
vitonsky Apr 5, 2026
e78f872
chore: update integrity header use
vitonsky Apr 5, 2026
742d49f
test: organize tests
vitonsky Apr 5, 2026
95afa98
refactor: unify encryption pipeline configuration
vitonsky Apr 5, 2026
8204ef7
refactor: new encryption pipeline
vitonsky Apr 5, 2026
f631cba
feat: cryptography utils in worker
vitonsky Apr 6, 2026
baa6fa4
refactor: use Argon2id for key derivation
vitonsky Apr 6, 2026
c623de1
build: disable fallback for note imports
vitonsky Apr 6, 2026
bf95376
chore: remove twofish from tsconfig
vitonsky Apr 7, 2026
8769fef
chore: update eslint config
vitonsky Apr 7, 2026
e5e3780
ci: build twofish
vitonsky Apr 7, 2026
8440469
ci: build Twofish
vitonsky Apr 7, 2026
78d2e7c
ci: use actual UID
vitonsky Apr 7, 2026
dddb740
ci: use actual UID
vitonsky Apr 7, 2026
84f5c2f
ci: use actual UID
vitonsky Apr 7, 2026
507857a
ci: use actual UID
vitonsky Apr 7, 2026
821d8cf
ci: use actual UID
vitonsky Apr 7, 2026
8054355
ci: use actual UID
vitonsky Apr 7, 2026
71e3699
chore: update contributing md
vitonsky Apr 7, 2026
3c69bf3
test: add AES spec test
vitonsky Apr 8, 2026
212c85d
test: update tests
vitonsky Apr 8, 2026
10a728f
chore: fix typo
vitonsky Apr 8, 2026
9a3e55e
chore: update deps
vitonsky Apr 8, 2026
6113300
test: use 32 bytes key
vitonsky Apr 8, 2026
4729a64
fix: return full range of pseudo random bytes
vitonsky Apr 8, 2026
a950b79
test: update snapshots
vitonsky Apr 8, 2026
ac3f01e
chore: remove comments
vitonsky Apr 8, 2026
05cea5e
chore: floor the numbers
vitonsky Apr 8, 2026
5fc254f
fix: padding for serpent encryption
vitonsky Apr 8, 2026
7fb39a4
chore: rename Twofish
vitonsky Apr 8, 2026
30ad606
fix: update var
vitonsky Apr 8, 2026
8fe716c
chore: remove debug print
vitonsky Apr 8, 2026
c5ed468
fix(twofish): chunking large buffers
vitonsky Apr 8, 2026
778e001
chore(XChaCha20): wait sodium init
vitonsky Apr 8, 2026
a1837a2
chore(XChaCha20): delete load method
vitonsky Apr 8, 2026
05477c7
chore(XChaCha20): use little endian bytes order
vitonsky Apr 8, 2026
e41c203
chore(XChaCha20): don't slice
vitonsky Apr 8, 2026
8291a47
test: improve asserts
vitonsky Apr 8, 2026
4cb227f
test: tampered mac
vitonsky Apr 8, 2026
0952a57
chore: reject invalid buffers
vitonsky Apr 8, 2026
bdf8349
chore: throw if buffer too small
vitonsky Apr 9, 2026
9e386bb
chore: remove unused code
vitonsky Apr 9, 2026
cff4051
chore: do not transfer buffers
vitonsky Apr 9, 2026
33c5efc
fix: use bytes length consistently
vitonsky Apr 9, 2026
25aaf4e
refactor: use bin struct for vault salt
vitonsky Apr 9, 2026
a0db6bd
refactor: split salt bytes
vitonsky Apr 9, 2026
28d0b77
fix: slice bytes
vitonsky Apr 9, 2026
8db25b1
chore: delete unnecessary packages
vitonsky Apr 9, 2026
d6d4b15
chore: update tsconfig
vitonsky Apr 9, 2026
c549768
chore: improve path to URL convertation
vitonsky Apr 9, 2026
d58d603
chore: update words
vitonsky Apr 9, 2026
568347f
fix: consistency of twofish wrapper
vitonsky Apr 9, 2026
7585211
chore: add bench for decryption time
vitonsky Apr 9, 2026
205274e
chore: explicitly return undefined
vitonsky Apr 9, 2026
785444a
chore: throw for invalid chunk size
vitonsky Apr 9, 2026
241eb73
test: partial buffer with no padding against CTR mode cipher
vitonsky Apr 9, 2026
eddd23e
docs: add license
vitonsky Apr 9, 2026
5fc66c7
chore: use builtin trap in twofish
vitonsky Apr 9, 2026
2a23bd1
build: clean tsdown config
vitonsky Apr 9, 2026
ed848ff
test: handle twofish errors
vitonsky Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
- name: Install deps
run: npm install

- name: Build Twofish WASM
working-directory: packages/twofish
run: |
DOCKER_UID=$(id -u)
DOCKER_GID=$(id -g)
export DOCKER_UID
export DOCKER_GID
npm run build

- name: Linter
run: npm run lint

Expand Down
52 changes: 52 additions & 0 deletions CONTRIBUTING.md
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
```
Comment thread
vitonsky marked this conversation as resolved.

## 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.
12 changes: 12 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,16 @@ export default tseslint.config(
],
},
},

// Nested packages
{
files: ['packages/twofish/**/*.ts'],
languageOptions: {
parserOptions: {
projectService: {
defaultProject: 'packages/twofish/tsconfig.json',
},
},
},
},
);
Loading
Loading