Merge from Widevine repo of http://go/wvgerrit/23436 This change is just comment changes: minor rewording and grammar fixes. Change-Id: I4cb2ef77715623fdb2567f5b504ffaceb937a480
39 lines
771 B
C++
39 lines
771 B
C++
// Copyright 2017 Google Inc. All Rights Reserved.
|
|
//
|
|
// Mock implementation of OEMCrypto APIs
|
|
//
|
|
#ifndef MOCK_OEMCRYPTO_NONCE_TABLE_H_
|
|
#define MOCK_OEMCRYPTO_NONCE_TABLE_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace wvoec_mock {
|
|
|
|
class NonceTable {
|
|
public:
|
|
static const int kTableSize = 16;
|
|
NonceTable() {
|
|
for (int i = 0; i < kTableSize; ++i) {
|
|
state_[i] = kNTStateInvalid;
|
|
}
|
|
}
|
|
~NonceTable() {}
|
|
void AddNonce(uint32_t nonce);
|
|
bool CheckNonce(uint32_t nonce);
|
|
void Flush();
|
|
|
|
private:
|
|
enum NonceTableState {
|
|
kNTStateInvalid,
|
|
kNTStateValid,
|
|
kNTStateFlushPending
|
|
};
|
|
NonceTableState state_[kTableSize];
|
|
uint32_t age_[kTableSize];
|
|
uint32_t nonces_[kTableSize];
|
|
};
|
|
|
|
} // namespace wvoec_mock
|
|
|
|
#endif // MOCK_OEMCRYPTO_NONCE_TABLE_H_
|