Files
opaque-vx/src/hash.rs
T

18 lines
814 B
Rust
Raw Normal View History

2020-07-27 15:25:04 -07:00
// Copyright (c) Facebook, Inc. and its affiliates.
//
2021-12-03 14:38:11 -08:00
// This source code is licensed under both the MIT license found in the
// LICENSE-MIT file in the root directory of this source tree and the Apache
// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
// of this source tree.
2020-07-27 15:25:04 -07:00
2020-10-21 18:20:43 -04:00
//! A convenience trait for digest bounds used throughout the library
2020-07-27 15:25:04 -07:00
use digest::{BlockInput, FixedOutput, Reset, Update};
/// Trait inheriting the requirements from digest::Digest for compatibility with HKDF and HMAC
// Associated types could be simplified when they are made as defaults:
// https://github.com/rust-lang/rust/issues/29661
pub trait Hash: Update + BlockInput + FixedOutput + Reset + Default + Clone {}
2020-07-27 15:25:04 -07:00
impl<T: Update + BlockInput + FixedOutput + Reset + Default + Clone> Hash for T {}