michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _nsCryptoHash_h_ michael@0: #define _nsCryptoHash_h_ michael@0: michael@0: #include "nsICryptoHash.h" michael@0: #include "nsICryptoHMAC.h" michael@0: #include "nsNSSShutDown.h" michael@0: #include "hasht.h" michael@0: #include "secmodt.h" michael@0: michael@0: class nsIInputStream; michael@0: michael@0: #define NS_CRYPTO_HASH_CID {0x36a1d3b3, 0xd886, 0x4317, {0x96, 0xff, 0x87, 0xb0, 0x00, 0x5c, 0xfe, 0xf7}} michael@0: #define NS_CRYPTO_HMAC_CID {0xa496d0a2, 0xdff7, 0x4e23, {0xbd, 0x65, 0x1c, 0xa7, 0x42, 0xfa, 0x17, 0x8a}} michael@0: michael@0: class nsCryptoHash : public nsICryptoHash, public nsNSSShutDownObject michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICRYPTOHASH michael@0: michael@0: nsCryptoHash(); michael@0: michael@0: private: michael@0: ~nsCryptoHash(); michael@0: michael@0: HASHContext* mHashContext; michael@0: bool mInitialized; michael@0: michael@0: virtual void virtualDestroyNSSReference(); michael@0: void destructorSafeDestroyNSSReference(); michael@0: }; michael@0: michael@0: class nsCryptoHMAC : public nsICryptoHMAC, public nsNSSShutDownObject michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICRYPTOHMAC michael@0: michael@0: nsCryptoHMAC(); michael@0: michael@0: private: michael@0: ~nsCryptoHMAC(); michael@0: PK11Context* mHMACContext; michael@0: michael@0: virtual void virtualDestroyNSSReference(); michael@0: void destructorSafeDestroyNSSReference(); michael@0: }; michael@0: michael@0: #endif // _nsCryptoHash_h_ michael@0: