Siddarth Kumar 926f6a3c72 Revert "test: bump go-libp2p"
This reverts commit d0ca4447c6c5642830354740d045f453eb3e77e8.
2024-01-18 20:29:33 +00:00

39 lines
770 B
Go

package dtls
func findMatchingSRTPProfile(a, b []SRTPProtectionProfile) (SRTPProtectionProfile, bool) {
for _, aProfile := range a {
for _, bProfile := range b {
if aProfile == bProfile {
return aProfile, true
}
}
}
return 0, false
}
func findMatchingCipherSuite(a, b []CipherSuite) (CipherSuite, bool) { //nolint
for _, aSuite := range a {
for _, bSuite := range b {
if aSuite.ID() == bSuite.ID() {
return aSuite, true
}
}
}
return nil, false
}
func splitBytes(bytes []byte, splitLen int) [][]byte {
splitBytes := make([][]byte, 0)
numBytes := len(bytes)
for i := 0; i < numBytes; i += splitLen {
j := i + splitLen
if j > numBytes {
j = numBytes
}
splitBytes = append(splitBytes, bytes[i:j])
}
return splitBytes
}