Skip to content

Commit 36b21e2

Browse files
author
Georg Bramm
committed
v0.3.0
1 parent a26275e commit 36b21e2

File tree

24 files changed

+928
-1372
lines changed

24 files changed

+928
-1372
lines changed

Cargo.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rabe"
3-
version = "0.2.7"
3+
version = "0.3.0"
44
description = "ABE Schemes implemented in rust."
55
authors = [
66
"Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>",
@@ -14,21 +14,26 @@ homepage = "https://github.com/Fraunhofer-AISEC/rabe"
1414
repository = "https://github.com/Fraunhofer-AISEC/rabe"
1515
documentation = "https://docs.rs/rabe"
1616

17+
[features]
18+
default = ["serde"]
19+
borsh = ["borsh/std", "rabe-bn/borsh"]
20+
serde = ["serde/std", "rabe-bn/serde"]
21+
1722
[lib]
1823
name="rabe"
1924
crate-type=["rlib", "cdylib"]
2025
path = "src/lib.rs"
2126

2227
[dependencies]
2328
aes = "0.7.0"
29+
borsh = { version = "0.9.3", optional = true, default-features = false }
2430
eax = "0.4.1"
2531
pest = "2.0"
2632
pest_derive = "2.0"
2733
permutation = "0.4.0"
28-
rabe-bn = "0.4.18"
34+
rabe-bn = { version = "0.4.20", optional = true, default-features = false }
2935
rand = "0.8.5"
30-
serde = "1.0.136"
31-
serde_derive = "1.0.136"
36+
serde = { version = "1.0", features = ["derive"], optional = true }
3237
sha3 = "0.9.1"
3338

3439
[workspace]
@@ -38,7 +43,7 @@ members = [
3843
]
3944

4045
[dev-dependencies]
41-
criterion = { version = "0.3", feaures = ["html_reports"]}
46+
criterion = { version = "0.3", features = ["html_reports"]}
4247
rand = "0.8.5"
4348

4449
[[bench]]

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
# Rabe
77

8-
rabe is a rust library implementing several Attribute Based Encryption (ABE) schemes using a modified version of the `bn` library of zcash (type-3 pairing / Baretto Naering curve). The modification of `bn` brings in `serde` instead of the deprecated `rustc_serialize`.
8+
rabe is a rust library implementing several Attribute Based Encryption (ABE) schemes using a modified version of the `bn` library of zcash (type-3 pairing / Baretto Naering curve). The modification of `bn` brings in `serde` or `borsh` instead of the deprecated `rustc_serialize`.
9+
The standard serialization library is `serde`. If you want to use `borsh`, you need to specify it as feature.
910

10-
This is a rust crate and comes with C bindings. For integration in distributed applications contact [us](mailto:info@aisec.fraunhofer.de).
11+
For integration in distributed applications contact [us](mailto:info@aisec.fraunhofer.de).
1112

1213
# Implemented Ciphertext Policy Schemes (CP-ABE)
1314

@@ -53,17 +54,10 @@ In order to compile and test:
5354
- install rust nightly
5455
- git clone library
5556
- install build-essential
56-
- and then run `cargo build --release && RUST_BACKTRACE=1 cargo test -- --nocapture`
57+
- and then run `cargo build --release && RUST_BACKTRACE=1 cargo test -- --nocapture`
58+
- rabe is also available with borsh serialization. just add `--features borsh` to build command
5759

5860
# Building rabe console app
5961

60-
In order to compile and test:
61-
- install rust nightly
62-
- git clone library
63-
- install build-essential
64-
- and then run `cargo run -p rabe-console`
62+
See [README.md](./rabe-console/README.md)
6563

66-
For example, in order to create msk and pk of an AC17 KP-ABE scheme run:
67-
```bash
68-
$ cargo run -p rabe-console -- --scheme AC17KP setup
69-
```

rabe-console/Cargo.toml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rabe-console"
3-
version = "0.2.7"
3+
version = "0.3.0"
44
description = "Console App for the ABE Schemes implemented in rabe."
55
authors = [
66
"Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>",
@@ -14,20 +14,25 @@ homepage = "https://github.com/Fraunhofer-AISEC/rabe"
1414
repository = "https://github.com/Fraunhofer-AISEC/rabe"
1515
documentation = "https://docs.rs/rabe"
1616

17+
[features]
18+
default = ["serde"]
19+
std = []
20+
borsh = ["borsh/std", "rabe/borsh"]
21+
serde = ["serde/std", "serde_cbor/std", "rabe/serde"]
22+
1723
[[bin]]
1824
name = "rabe"
1925
path = "src/mod.rs"
2026

2127
[dependencies]
22-
base64 = "0.10.1"
28+
borsh = { version = "0.9.3", optional = true, default-features = false }
29+
rustc-hex = "2.1.0"
2330
deflate = "0.9.0"
2431
inflate = "0.4.5"
2532
clap = "2.33.3"
2633
rand = "0.8.5"
27-
serde = "1.0.136"
28-
serde_derive = "1.0.136"
29-
serde_json = "1.0.79"
30-
serde_cbor = "0.11.2"
34+
serde = { version = "1.0", features = ["derive"], optional = true }
35+
serde_cbor = { version = "0.11.2", optional = true, default-features = false }
3136
pest = "2.0"
3237
pest_derive = "2.0"
33-
rabe = { path = "../" }
38+
rabe = { path = "..", optional = true, default-features = false }

rabe-console/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Rabe console app
2+
3+
This is an example console app, to test the implemented schemes
4+
5+
For integration in distributed applications contact [us](mailto:info@aisec.fraunhofer.de).
6+
7+
8+
# Building
9+
10+
In order to compile and test:
11+
- install rust nightly
12+
- git clone library
13+
- install build-essential
14+
- Do one of the following
15+
- run `cargo run -p rabe-console` from parent directory
16+
- run `cargo run` from this directory
17+
- compile using `cargo build --release` and afterwards run executable `./target/release/rabe`
18+
19+
## Example calls using executable
20+
- Setup a AC17 KP-ABE scheme
21+
* ```bash
22+
$ rabe --s AC17CP setup
23+
```
24+
* This generates msk.key and pk.key
25+
- Generate a new key with attributes "A" and "B"
26+
* ```bash
27+
$ rabe --s AC17CP keygen --a 'A B'
28+
```

0 commit comments

Comments
 (0)