@@ -17,7 +17,8 @@ const (
1717 ProtectionProfileAeadAes256Gcm ProtectionProfile = 0x0008
1818)
1919
20- func (p ProtectionProfile ) keyLen () (int , error ) {
20+ // KeyLen returns length of encryption key in bytes.
21+ func (p ProtectionProfile ) KeyLen () (int , error ) {
2122 switch p {
2223 case ProtectionProfileAes128CmHmacSha1_32 , ProtectionProfileAes128CmHmacSha1_80 , ProtectionProfileAeadAes128Gcm :
2324 return 16 , nil
@@ -28,7 +29,8 @@ func (p ProtectionProfile) keyLen() (int, error) {
2829 }
2930}
3031
31- func (p ProtectionProfile ) saltLen () (int , error ) {
32+ // SaltLen returns length of salt key in bytes.
33+ func (p ProtectionProfile ) SaltLen () (int , error ) {
3234 switch p {
3335 case ProtectionProfileAes128CmHmacSha1_32 , ProtectionProfileAes128CmHmacSha1_80 :
3436 return 14 , nil
@@ -39,7 +41,8 @@ func (p ProtectionProfile) saltLen() (int, error) {
3941 }
4042}
4143
42- func (p ProtectionProfile ) rtpAuthTagLen () (int , error ) {
44+ // AuthTagRTPLen returns length of RTP authentication tag in bytes for AES protection profiles. For AEAD ones it returns zero.
45+ func (p ProtectionProfile ) AuthTagRTPLen () (int , error ) {
4346 switch p {
4447 case ProtectionProfileAes128CmHmacSha1_80 :
4548 return 10 , nil
@@ -52,7 +55,8 @@ func (p ProtectionProfile) rtpAuthTagLen() (int, error) {
5255 }
5356}
5457
55- func (p ProtectionProfile ) rtcpAuthTagLen () (int , error ) {
58+ // AuthTagRTCPLen returns length of RTCP authentication tag in bytes for AES protection profiles. For AEAD ones it returns zero.
59+ func (p ProtectionProfile ) AuthTagRTCPLen () (int , error ) {
5660 switch p {
5761 case ProtectionProfileAes128CmHmacSha1_32 , ProtectionProfileAes128CmHmacSha1_80 :
5862 return 10 , nil
@@ -63,7 +67,8 @@ func (p ProtectionProfile) rtcpAuthTagLen() (int, error) {
6367 }
6468}
6569
66- func (p ProtectionProfile ) aeadAuthTagLen () (int , error ) {
70+ // AEADAuthTagLen returns length of authentication tag in bytes for AEAD protection profiles. For AES ones it returns zero.
71+ func (p ProtectionProfile ) AEADAuthTagLen () (int , error ) {
6772 switch p {
6873 case ProtectionProfileAes128CmHmacSha1_32 , ProtectionProfileAes128CmHmacSha1_80 :
6974 return 0 , nil
@@ -74,7 +79,8 @@ func (p ProtectionProfile) aeadAuthTagLen() (int, error) {
7479 }
7580}
7681
77- func (p ProtectionProfile ) authKeyLen () (int , error ) {
82+ // AuthKeyLen returns length of authentication key in bytes for AES protection profiles. For AEAD ones it returns zero.
83+ func (p ProtectionProfile ) AuthKeyLen () (int , error ) {
7884 switch p {
7985 case ProtectionProfileAes128CmHmacSha1_32 , ProtectionProfileAes128CmHmacSha1_80 :
8086 return 20 , nil
@@ -85,6 +91,7 @@ func (p ProtectionProfile) authKeyLen() (int, error) {
8591 }
8692}
8793
94+ // String returns the name of the protection profile.
8895func (p ProtectionProfile ) String () string {
8996 switch p {
9097 case ProtectionProfileAes128CmHmacSha1_80 :
0 commit comments