wtx 0.50.0

A collection of different transport implementations and related tools focused primarily on web technologies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::crypto::{Hkdf as _, HkdfSha256Global, HkdfSha384Global};

#[derive(Debug)]
pub(crate) enum TlsHkdf {
  Sha256(HkdfSha256Global),
  Sha384(HkdfSha384Global),
}

impl TlsHkdf {
  #[inline]
  pub(crate) fn expand(&self, info: &[u8], okm: &mut [u8]) -> crate::Result<()> {
    match self {
      Self::Sha256(el) => el.expand(info, okm),
      Self::Sha384(el) => el.expand(info, okm),
    }
  }
}