You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
## 0.2.9
4
4
5
5
- Add ed25519 support
6
+
- Add renamed features: `aes-openssl`, `aes-rust`, `aes-short-nonce`. The old features (`openssl`, `pure`, `aes-12bytes-nonce`) are still supported, but will be removed in the future
ecies = {version = "0.2", features = ["ed25519"]} # or if you know what you are doing
53
55
```
54
56
55
-
## Optional pure Rust AES backend
57
+
### Secp256k1-specific configuration
58
+
59
+
Some behaviors can be configured by global static variable:
60
+
61
+
```rust
62
+
pubstructConfig {
63
+
pubis_ephemeral_key_compressed:bool,
64
+
pubis_hkdf_key_compressed:bool
65
+
}
66
+
```
67
+
68
+
On `is_ephemeral_key_compressed: true`, the payload would be like: `33 Bytes + AES` instead of `65 Bytes + AES`.
69
+
70
+
On `is_hkdf_key_compressed: true`, the hkdf key would be derived from `ephemeral public key (compressed) + shared public key (compressed)` instead of `ephemeral public key (uncompressed) + shared public key (uncompressed)`.
71
+
72
+
```rust
73
+
useecies::config::{Config, update_config};
74
+
75
+
update_config(Config {
76
+
is_ephemeral_key_compressed:true,
77
+
is_hkdf_key_compressed:true
78
+
});
79
+
```
80
+
81
+
For compatibility, make sure different applications share the same configuration. Normally configuration is only updated once on initialization, if not, beware of race condition.
82
+
83
+
## Symmetric cipher configuration
84
+
85
+
### Optional pure Rust AES backend
56
86
57
87
You can choose to use OpenSSL implementation or [pure Rust implementation](https://github.com/RustCrypto/AEADs) of AES-256-GCM:
It can speed up AES encryption/decryption. This would be no longer necessary when [`aes-gcm` supports automatic CPU detection](https://github.com/RustCrypto/AEADs/issues/243#issuecomment-738821935).
78
110
79
-
On ARM CPUs, consider building with
111
+
#### Build on ARM CPUs
112
+
113
+
On ARM CPUs (like Apple), consider building with
80
114
81
115
```bash
82
-
RUSTFLAGS="--cfg aes_armv8"# Rust 1.61+
116
+
RUSTFLAGS="--cfg aes_armv8"
83
117
```
84
118
85
-
## WASM compatibility
86
-
87
-
It's also possible to build to the `wasm32-unknown-unknown` target (or `wasm32-wasip2`) with the pure Rust backend. Check out [this repo](https://github.com/ecies/rs-wasm) for more details.
88
-
89
-
## Configuration
90
-
91
-
You can enable 12 bytes nonce by `aes-12bytes-nonce` feature on OpenSSL or pure Rust AES backend.
92
-
93
-
```toml
94
-
ecies = {version = "0.2", features = ["aes-12bytes-nonce"]} # it also works with "pure"
95
-
```
119
+
### Optional pure Rust XChaCha20-Poly1305 backend
96
120
97
121
You can also enable a pure Rust [XChaCha20-Poly1305](https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305) backend.
Other behaviors can be configured by global static variable:
127
+
On ARM CPUs, enable SIMD with
106
128
107
-
```rust
108
-
pubstructConfig {
109
-
pubis_ephemeral_key_compressed:bool,
110
-
pubis_hkdf_key_compressed:bool
111
-
}
129
+
```bash
130
+
RUSTFLAGS="--cfg chacha20_force_neon"
112
131
```
113
132
114
-
On `is_ephemeral_key_compressed: true`, the payload would be like: `33 Bytes + AES` instead of `65 Bytes + AES`.
115
-
116
-
On `is_hkdf_key_compressed: true`, the hkdf key would be derived from `ephemeral public key (compressed) + shared public key (compressed)` instead of `ephemeral public key (uncompressed) + shared public key (uncompressed)`.
117
-
118
-
```rust
119
-
useecies::config::{Config, update_config};
120
-
121
-
update_config(Config {
122
-
is_ephemeral_key_compressed:true,
123
-
is_hkdf_key_compressed:true
124
-
});
125
-
```
133
+
## WASM compatibility
126
134
127
-
For compatibility, make sure different applications share the same configuration. Normally configuration is only updated once on initialization, if not, beware of race condition.
135
+
It's also possible to build to the `wasm32-unknown-unknown` target (or `wasm32-wasip2`) with the pure Rust backend. Check out [this repo](https://github.com/ecies/rs-wasm) for more details.
128
136
129
137
## Security
130
138
@@ -136,7 +144,7 @@ For key derivation functions on shared points between two asymmetric keys, HKDFs
136
144
137
145
### Why XChaCha20-Poly1305 instead of AES-256-GCM
138
146
139
-
XChaCha20-Poly1305 is a competitive alternative to AES-256-GCM because it's fast and constant-time without hardware acceleration (resistant to cache-timing attacks). It also has longer nonce length to alleviate the risk of birthday attacks when nonces are generated randomly.
147
+
XChaCha20-Poly1305 is a competitive alternative to AES-256-GCM because it's fast and constant-time without dedicated hardware acceleration (resistant to cache-timing attacks). It also has longer nonce length to alleviate the risk of birthday attacks when nonces are generated randomly.
140
148
141
149
### Cross-language compatibility
142
150
@@ -151,66 +159,61 @@ Following dependencies are audited:
151
159
152
160
## Benchmark
153
161
154
-
On MacBook Pro Mid 2015 (15-inch, 2.8 GHz Quad-Core Intel Core i7) on July 19, 2023.
162
+
On Mac mini M4 Pro (24 GB) on Apr 2, 2025, secp256k1 only.
0 commit comments