Skip to content

Commit

Permalink
make protectionProfile public
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Jun 29, 2024
1 parent f5dd5fd commit d51a0ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rtc-srtp/src/protection_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub enum ProtectionProfile {
}

impl ProtectionProfile {
pub(crate) fn key_len(&self) -> usize {
pub fn key_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_32
| ProtectionProfile::Aes128CmHmacSha1_80
Expand All @@ -19,36 +19,36 @@ impl ProtectionProfile {
}
}

pub(crate) fn salt_len(&self) -> usize {
pub fn salt_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_32 | ProtectionProfile::Aes128CmHmacSha1_80 => 14,
ProtectionProfile::AeadAes128Gcm | ProtectionProfile::AeadAes256Gcm => 12,
}
}

pub(crate) fn rtp_auth_tag_len(&self) -> usize {
pub fn rtp_auth_tag_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_80 => 10,
ProtectionProfile::Aes128CmHmacSha1_32 => 4,
ProtectionProfile::AeadAes128Gcm | ProtectionProfile::AeadAes256Gcm => 0,
}
}

pub(crate) fn rtcp_auth_tag_len(&self) -> usize {
pub fn rtcp_auth_tag_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_80 | ProtectionProfile::Aes128CmHmacSha1_32 => 10,
ProtectionProfile::AeadAes128Gcm | ProtectionProfile::AeadAes256Gcm => 0,
}
}

pub(crate) fn aead_auth_tag_len(&self) -> usize {
pub fn aead_auth_tag_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_80 | ProtectionProfile::Aes128CmHmacSha1_32 => 0,
ProtectionProfile::AeadAes128Gcm | ProtectionProfile::AeadAes256Gcm => 16,
}
}

pub(crate) fn auth_key_len(&self) -> usize {
pub fn auth_key_len(&self) -> usize {
match *self {
ProtectionProfile::Aes128CmHmacSha1_80 | ProtectionProfile::Aes128CmHmacSha1_32 => 20,
ProtectionProfile::AeadAes128Gcm | ProtectionProfile::AeadAes256Gcm => 0,
Expand Down

0 comments on commit d51a0ac

Please sign in to comment.