Skip to content

Commit da18052

Browse files
committed
Add docs about wasm and no_std. Fix std not being default
Signed-off-by: maurges <[email protected]>
1 parent bdf9498 commit da18052

File tree

6 files changed

+39
-3
lines changed

6 files changed

+39
-3
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- [HD wallets support](#hd-wallets-support)
2222
- [SPOF code: Key Import and Export](#spof-code-key-import-and-export)
2323
- [Big integer implementation](#big-integer-implementation)
24+
- [no\_std compatability](#no_std-compatability)
2425
- [Differences between the implementation and CGGMP24](#differences-between-the-implementation-and-cggmp24)
2526
- [Timing attacks](#timing-attacks)
2627
- [Join us in Discord!](#join-us-in-discord)
@@ -243,6 +244,23 @@ some applications by several times, but requires an LGPL dependency
243244
- To use num-bigint, select the feature `backend-num-bigint` (selected as
244245
**default** feature)
245246

247+
## no\_std compatability
248+
249+
Every crate in this project is compatible with no\_std, provided that
250+
`num-bigint` backend is chosen. The presence of `alloc` is still required. This
251+
means that `cggmp24` and `cggmp24-keygen` can be run on a
252+
`wasm32-unknown-unknown` platform.
253+
254+
To compile the crates for `no_std`, you need to disable the default feature
255+
"std" and instead enable `no_std` for some crates. The dependencies in your
256+
cargo file should look like this:
257+
258+
```toml
259+
cggmp24 = { version = "0.7", default-features = false, features = ["no_std", "backend-num-bigint"] }
260+
cggmp24-keygen = { version = "0.7", default-features = false }
261+
key-share = { version = "0.6", default-features = false }
262+
```
263+
246264
## Differences between the implementation and CGGMP24
247265
[CGGMP24] only defines a non-threshold protocol. To support general thresholds,
248266
we defined our own CGGMP24-like key generation and threshold signing

cggmp24/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Changes:
66
* All protocols have been updated to follow the latest CGGMP24 paper revision.
7-
* Change big integer backend to be abstract, selectable between rug and num-bigint [#13]
7+
* Change big integer backend to be abstract, selectable between rug and num-bigint
88

99
Breaking changes:
1010
* The structure `cggmp24::key_share::AuxInfo` has been updated and consequently `cggmp24::KeyShare`

cggmp24/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ rand_dev = { workspace = true }
4646
generic-tests = { workspace = true }
4747

4848
[features]
49-
default = ["backend-num-bigint"]
49+
default = ["std", "backend-num-bigint"]
5050

5151
all-curves = ["curve-secp256k1", "curve-secp256r1", "curve-stark"]
5252
curve-secp256k1 = ["generic-ec/curve-secp256k1", "hd-wallet?/curve-secp256k1"]

cggmp24/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,23 @@
267267
//! - To use num-bigint, select the feature `backend-num-bigint` (selected as
268268
//! **default** feature)
269269
//!
270+
//! ## no\_std compatability
271+
//!
272+
//! Every crate in this project is compatible with no\_std, provided that
273+
//! `num-bigint` backend is chosen. The presence of `alloc` is still required. This
274+
//! means that `cggmp24` and `cggmp24-keygen` can be run on a
275+
//! `wasm32-unknown-unknown` platform.
276+
//!
277+
//! To compile the crates for `no_std`, you need to disable the default feature
278+
//! "std" and instead enable `no_std` for some crates. The dependencies in your
279+
//! cargo file should look like this:
280+
//!
281+
//! ```toml
282+
//! cggmp24 = { version = "0.7", default-features = false, features = ["no_std", "backend-num-bigint"] }
283+
//! cggmp24-keygen = { version = "0.7", default-features = false }
284+
//! key-share = { version = "0.6", default-features = false }
285+
//! ```
286+
//!
270287
//! ## Differences between the implementation and CGGMP24
271288
//! [CGGMP24] only defines a non-threshold protocol. To support general thresholds,
272289
//! we defined our own CGGMP24-like key generation and threshold signing

docs/toc-cggmp24.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [HD wallets support](#hd-wallets-support)
1313
- [SPOF code: Key Import and Export](#spof-code-key-import-and-export)
1414
- [Big integer implementation](#big-integer-implementation)
15+
- [no\_std compatability](#no_std-compatability)
1516
- [Differences between the implementation and CGGMP24](#differences-between-the-implementation-and-cggmp24)
1617
- [Timing attacks](#timing-attacks)
1718
- [Join us in Discord!](#join-us-in-discord)

paillier-zk/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## v0.7.0
44
* Proofs are updated to follow the latest CGGMP24 paper revision.
5-
* Change big integer backend to be abstract, selectable between rug and num-bigint [#13]
5+
* Change big integer backend to be abstract, selectable between rug and num-bigint
66

77
# CGGMP21 releases
88

0 commit comments

Comments
 (0)