@@ -28,18 +28,18 @@ An introduction to working with the Tink API is [provided here](docs/RUST-HOWTO.
28
28
29
29
## Crate Structure
30
30
31
- The core ` tink ` crate holds common functionality and includes the ` trait ` definitions for all
31
+ The ` tink-core ` crate holds common functionality and includes the ` trait ` definitions for all
32
32
[ primitives] ( https://github.com/google/tink/blob/v1.5.0/docs/PRIMITIVES.md ) , but includes
33
33
very little cryptographic functionality.
34
34
35
35
Individual cryptographic primitives are implemented in ` tink-<primitive> ` crates, which depend on:
36
36
37
- - the ` tink ` crate for common types and helpers
37
+ - the ` tink-core ` crate for common types and helpers
38
38
- the ` tink-proto ` crate for protobuf-derived ` struct ` s
39
39
- the RustCrypto crates to provide underlying cryptographic implementations.
40
40
41
41
For example, the ` tink-aead ` crate provides code that performs authenticated encryption with additional data (AEAD),
42
- implementing the ` tink:: Aead` trait.
42
+ implementing the ` Aead ` trait from ` tink-core ` .
43
43
44
44
All of the tests for the Tink crates are integration tests (i.e. only use public APIs) and reside in a separate
45
45
` tink-tests ` crate.
@@ -108,7 +108,7 @@ Many Go functions return values of form `(ReturnType, error)`; the Rust equivale
108
108
where ` E ` is some type that implements the [ ` Error ` trait] ( https://doc.rust-lang.org/std/error/trait.Error.html ) .
109
109
110
110
The Rust port uses the ` TinkError ` type for ` E ` . This type includes an optional inner ` Error ` , and the
111
- ` tink ::utils` module also includes the ` wrap_err() ` helper, which is used as an equivalent for the common Go pattern
111
+ ` tink_core ::utils` module also includes the ` wrap_err() ` helper, which is used as an equivalent for the common Go pattern
112
112
of wrapping errors:
113
113
114
114
``` Go
@@ -178,13 +178,13 @@ places (e.g. hash function names, curve names). Wherever possible, the Rust por
178
178
179
179
### JSON Output
180
180
181
- Tink supports the encoding of ` Keyset ` and ` EncryptedKeyset ` types as JSON when the ` json ` feature of the ` tink ` crate
181
+ Tink supports the encoding of ` Keyset ` and ` EncryptedKeyset ` types as JSON when the ` json ` feature of the ` tink-core ` crate
182
182
is enabled, with the following conventions:
183
183
184
184
- Values of type ` bytes ` are serialized to base64-encoded strings (standard encoding).
185
185
- Enum values are serialized as capitalized strings (e.g. ` "ASYMMETRIC_PRIVATE" ` ).
186
186
187
- The ` tink ::keyset::json_io` module includes ` serde ` serialization code which matches these conventions, and
187
+ The ` tink_core ::keyset::json_io` module includes ` serde ` serialization code which matches these conventions, and
188
188
the [ prost-build] ( https://crates.io/crates/prost-build ) invocation that creates the Rust protobuf message
189
189
definitions includes a collection of extra options to force the generation of the appropriate ` serde `
190
190
attributes.
@@ -197,20 +197,20 @@ This section describes the mapping between the upstream Go packages and the equi
197
197
198
198
| Rust Crate/Module | Go Package |
199
199
| ----------------------| ------------|
200
- | ` tink ::cryptofmt` | ` core/cryptofmt ` |
201
- | ` tink ::keyset` | ` keyset ` |
202
- | ` tink ::primitiveset` | ` core/primitiveset ` |
203
- | ` tink ::registry` | ` core/registry ` |
204
- | ` tink ` | ` tink ` |
200
+ | ` tink_core ::cryptofmt` | ` core/cryptofmt ` |
201
+ | ` tink_core ::keyset` | ` keyset ` |
202
+ | ` tink_core ::primitiveset` | ` core/primitiveset ` |
203
+ | ` tink_core ::registry` | ` core/registry ` |
204
+ | ` tink-core ` | ` tink ` |
205
205
| ` tink-proto ` | ` *_go_proto ` |
206
206
207
207
#### Common Crypto
208
208
209
209
| Rust Crate/Module | Go Package |
210
210
| ------------------------| ------------|
211
211
| | ` kwp ` |
212
- | ` tink ::subtle::random` | ` subtle/random ` |
213
- | ` tink ::subtle` | ` subtle ` |
212
+ | ` tink_core ::subtle::random` | ` subtle/random ` |
213
+ | ` tink_core ::subtle` | ` subtle ` |
214
214
215
215
#### Primitives
216
216
@@ -228,10 +228,10 @@ This section describes the mapping between the upstream Go packages and the equi
228
228
229
229
| Rust Crate/Module | Go Package | Notes |
230
230
| --------------------------| ------------| --------|
231
- | ` tink ::keyset::insecure` | ` insecurecleartextkeyset ` | Gated on (non-default) ` insecure ` feature |
232
- | ` tink ::keyset::insecure` | ` internal ` | Gated on (non-default) ` insecure ` feature |
233
- | ` tink ::keyset::insecure` | ` testkeyset ` | Gated on (non-default) ` insecure ` feature |
234
- | ` tink-tests ` | ` testutil ` | Depends on ` insecure ` feature of ` tink ` crate |
231
+ | ` tink_core ::keyset::insecure` | ` insecurecleartextkeyset ` | Gated on (non-default) ` insecure ` feature |
232
+ | ` tink_core ::keyset::insecure` | ` internal ` | Gated on (non-default) ` insecure ` feature |
233
+ | ` tink_core ::keyset::insecure` | ` testkeyset ` | Gated on (non-default) ` insecure ` feature |
234
+ | ` tink-tests ` | ` testutil ` | Depends on ` insecure ` feature of ` tink-core ` crate |
235
235
| ` tink-testing ` | ` services ` (` /testing/go/ ` ) |
236
236
| ` tink-testing::proto ` | ` testing_api_go_grpc ` (` /proto/testing/ ` ) |
237
237
| | ` main ` (` /tools/testing/go/ ` ) |
0 commit comments