blob: ae02310ebae205f2314a9d6ecc8d508139658ab4 [file] [log] [blame]
zstein4dde3df2017-07-07 21:26:251/*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Steve Anton10542f22019-01-11 17:11:0011#ifndef PC_TEST_SRTP_TEST_UTIL_H_
12#define PC_TEST_SRTP_TEST_UTIL_H_
zstein4dde3df2017-07-07 21:26:2513
14#include <string>
15
16namespace rtc {
17
Mirko Bonadei7750d802021-07-26 15:27:4218extern const char kCsAesCm128HmacSha1_32[];
19extern const char kCsAeadAes128Gcm[];
20extern const char kCsAeadAes256Gcm[];
zstein4dde3df2017-07-07 21:26:2521
22static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234";
23static const uint8_t kTestKey2[] = "4321ZYXWVUTSRQPONMLKJIHGFEDCBA";
24static const int kTestKeyLen = 30;
25
26static int rtp_auth_tag_len(const std::string& cs) {
Mirko Bonadei7750d802021-07-26 15:27:4227 if (cs == kCsAesCm128HmacSha1_32) {
zstein4dde3df2017-07-07 21:26:2528 return 4;
Mirko Bonadei7750d802021-07-26 15:27:4229 } else if (cs == kCsAeadAes128Gcm || cs == kCsAeadAes256Gcm) {
zstein4dde3df2017-07-07 21:26:2530 return 16;
31 } else {
32 return 10;
33 }
34}
35static int rtcp_auth_tag_len(const std::string& cs) {
Mirko Bonadei7750d802021-07-26 15:27:4236 if (cs == kCsAeadAes128Gcm || cs == kCsAeadAes256Gcm) {
zstein4dde3df2017-07-07 21:26:2537 return 16;
38 } else {
39 return 10;
40 }
41}
42
43} // namespace rtc
44
Steve Anton10542f22019-01-11 17:11:0045#endif // PC_TEST_SRTP_TEST_UTIL_H_