Skip to content

Commit 7195de5

Browse files
authored
Merge pull request #1798 from cosmos/finish-up-0.36
Finish up 0.36
2 parents 39e712a + 61139cc commit 7195de5

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ and this project adheres to
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Migrate from libsodium to different implementation in order to reduce bundle
12+
size and improve compatibility.
13+
14+
- ed25519 now uses @noble/curves
15+
- xchacha20poly1305 now uses @noble/ciphers
16+
- Argon2 now uses hash-wasm
17+
18+
([#1722])
19+
20+
[#1722]: https://github.com/cosmos/cosmjs/pull/1722
21+
22+
### Deprecated
23+
24+
- The use of encrypted wallet storage is deprecated. In particular this means:
25+
26+
- `Secp256k1HdWallet.serialize`/`.serializeWithEncryptionKey`
27+
- `Secp256k1HdWallet.deserialize`/`.deserializeWithEncryptionKey`
28+
- `DirectSecp256k1HdWallet.serialize`/`.serializeWithEncryptionKey`
29+
- `DirectSecp256k1HdWallet.deserialize`/`.deserializeWithEncryptionKey`
30+
31+
If you are using any of those methods, please comment at
32+
https://github.com/cosmos/cosmjs/issues/1796.
33+
34+
A scream test was established which slows down the key derivation function a
35+
lot. This simulates the use of a pure-JS implementation of Argon2 which we
36+
will use on one of the next releases. If this causes problems for your app,
37+
switch back to `^0.35.0` and comment in the issue.
38+
39+
([#1797])
40+
41+
[#1797]: https://github.com/cosmos/cosmjs/pull/1797
42+
943
## [0.35.0] - 2025-08-13
1044

1145
### Added

packages/amino/src/wallet.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Xchacha20poly1305Ietf,
77
} from "@cosmjs/crypto";
88
import { toAscii } from "@cosmjs/encoding";
9+
import { sleep } from "@cosmjs/utils";
910

1011
/**
1112
* A fixed salt is chosen to archive a deterministic password to key derivation.
@@ -34,7 +35,7 @@ export async function executeKdf(password: string, configuration: KdfConfigurati
3435

3536
// Emulate a slower implementation. The fast WASM code may get removed.
3637
// This approximates the speed of using a pure JS implementation (@noble/hashes) in Node 22.
37-
const screamTest = new Promise((resolve) => setTimeout(resolve, options.opsLimit * 250));
38+
const screamTest = sleep(options.opsLimit * 250);
3839
const result = await Argon2id.execute(password, cosmjsSalt, options);
3940
await screamTest;
4041
return result;

packages/proto-signing/src/wallet.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Xchacha20poly1305Ietf,
77
} from "@cosmjs/crypto";
88
import { toAscii } from "@cosmjs/encoding";
9+
import { sleep } from "@cosmjs/utils";
910

1011
/**
1112
* A fixed salt is chosen to archive a deterministic password to key derivation.
@@ -31,7 +32,7 @@ export async function executeKdf(password: string, configuration: KdfConfigurati
3132

3233
// Emulate a slower implementation. The fast WASM code may get removed.
3334
// This approximates the speed of using a pure JS implementation (@noble/hashes) in Node 22.
34-
const screamTest = new Promise((resolve) => setTimeout(resolve, options.opsLimit * 250));
35+
const screamTest = sleep(options.opsLimit * 250);
3536
const result = await Argon2id.execute(password, cosmjsSalt, options);
3637
await screamTest;
3738
return result;

0 commit comments

Comments
 (0)