summaryrefslogtreecommitdiff
path: root/chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h
blob: 8579ccf1f901ead6117a06cb46456d57b55254c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_
#define COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_

#include "base/strings/string_piece.h"

namespace gcm {

struct IncomingMessage;

// Creates an encrypted representation of |payload| using the |peer_public_key|
// (as an octet string in uncompressed form per SEC1 2.3.3) and the
// |auth_secret|. Returns whether the payload could be created and has been
// written to the |*message|.
bool CreateEncryptedPayloadForTesting(const base::StringPiece& payload,
                                      const base::StringPiece& peer_public_key,
                                      const base::StringPiece& auth_secret,
                                      IncomingMessage* message);

}  // namespace gcm

#endif  // COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_