Skip to content

Commit bc4a9bf

Browse files
committed
newtypes support
1 parent 0d0369f commit bc4a9bf

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

Cargo.lock

+5-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ members = [
2727

2828
[profile.dev]
2929
opt-level = 2
30+
31+
[patch.crates-io]
32+
digest = { git = "https://github.com/baloo/traits.git", branch = "baloo/digest/new-type" }

sha2/src/lib.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ impl_oid_carrier!(OidSha512_256, "2.16.840.1.101.3.4.2.6");
4848

4949
/// SHA-224 hasher.
5050
pub type Sha224 = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, U28, OidSha224>>;
51-
/// SHA-256 hasher.
52-
pub type Sha256 = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, U32, OidSha256>>;
51+
52+
digest::newtype!(
53+
"SHA-256 hasher",
54+
Sha256,
55+
__sha256,
56+
CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, U32, OidSha256>>
57+
);
58+
5359
/// SHA-512/224 hasher.
5460
pub type Sha512_224 = CoreWrapper<CtVariableCoreWrapper<Sha512VarCore, U28, OidSha512_224>>;
5561
/// SHA-512/256 hasher.

0 commit comments

Comments
 (0)