Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/security/manager/ssl/nsCryptoHash.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
 *
3
 * This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef nsCryptoHash_h
8
#define nsCryptoHash_h
9
10
#include "ScopedNSSTypes.h"
11
#include "hasht.h"
12
#include "nsICryptoHMAC.h"
13
#include "nsICryptoHash.h"
14
#include "secmodt.h"
15
16
class nsIInputStream;
17
18
#define NS_CRYPTO_HASH_CID {0x36a1d3b3, 0xd886, 0x4317, {0x96, 0xff, 0x87, 0xb0, 0x00, 0x5c, 0xfe, 0xf7}}
19
#define NS_CRYPTO_HMAC_CID {0xa496d0a2, 0xdff7, 0x4e23, {0xbd, 0x65, 0x1c, 0xa7, 0x42, 0xfa, 0x17, 0x8a}}
20
21
class nsCryptoHash final : public nsICryptoHash
22
{
23
public:
24
  NS_DECL_ISUPPORTS
25
  NS_DECL_NSICRYPTOHASH
26
27
  nsCryptoHash();
28
29
private:
30
0
  virtual ~nsCryptoHash() {}
31
32
  mozilla::UniqueHASHContext mHashContext;
33
  bool mInitialized;
34
};
35
36
class nsCryptoHMAC : public nsICryptoHMAC
37
{
38
public:
39
  NS_DECL_ISUPPORTS
40
  NS_DECL_NSICRYPTOHMAC
41
42
  nsCryptoHMAC();
43
44
private:
45
0
  virtual ~nsCryptoHMAC() {}
46
47
  mozilla::UniquePK11Context mHMACContext;
48
};
49
50
#endif // nsCryptoHash_h