(This is a merge of http://go/wvgerrit/134311.) This patch widens the variable type used for lengths in wvcrc32 from int to size_t. This fixes code that would trigger -Wshorten-64-to-32 by implicitly narrowing a variable from 64 to 32 bits. Bug: 194971260 Test: x86-64 Change-Id: I2887c18ff2a2c6dd3d65f966d9d1203fb050f736
24 lines
630 B
C++
24 lines
630 B
C++
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine
|
|
// License Agreement.
|
|
//
|
|
// Compute CRC32 Checksum. Needed for verification of WV Keybox.
|
|
//
|
|
#ifndef CDM_WVCRC32_H_
|
|
#define CDM_WVCRC32_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace wvoec {
|
|
|
|
uint32_t wvcrc32(const uint8_t* p_begin, size_t i_count);
|
|
uint32_t wvcrc32Init();
|
|
uint32_t wvcrc32Cont(const uint8_t* p_begin, size_t i_count, uint32_t prev_crc);
|
|
|
|
// Convert to network byte order
|
|
uint32_t wvcrc32n(const uint8_t* p_begin, size_t i_count);
|
|
|
|
} // namespace wvoec
|
|
|
|
#endif // CDM_WVCRC32_H_
|