1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: crypto_HashContextBase.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 17 #ifndef NN_CRYPTO_CRYPTO_HASHCONTEXTBASE_H_ 18 #define NN_CRYPTO_CRYPTO_HASHCONTEXTBASE_H_ 19 20 #include <nn/types.h> 21 #include <nn/config.h> 22 23 #ifdef __cplusplus 24 25 namespace nn{ namespace crypto{ 26 27 /* Please see man pages for details 28 29 30 31 32 33 34 */ 35 class HashContextBase 36 { 37 public: 38 39 /* 40 41 42 43 */ Initialize()44 virtual void Initialize() {} 45 46 /* 47 48 49 50 */ Finalize()51 virtual void Finalize() {} 52 53 /* 54 55 56 57 */ Update(const void * pData,size_t size)58 virtual void Update(const void* pData, size_t size) 59 { 60 NN_UNUSED_VAR(pData); 61 NN_UNUSED_VAR(size); 62 } 63 64 /* 65 66 67 68 */ GetHashSize()69 virtual size_t GetHashSize() { return 0; } GetHashLength()70 size_t GetHashLength() NN_ATTRIBUTE_DEPRECATED { return GetHashSize(); } 71 72 /* 73 74 75 76 */ GetHash(void * pOut)77 virtual void GetHash(void* pOut) 78 { 79 NN_UNUSED_VAR(pOut); 80 } 81 82 protected: 83 84 // Prohibit individual instantiation HashContextBase()85 HashContextBase() {} ~HashContextBase()86 virtual ~HashContextBase() {} 87 88 // Internal block process ProcessBlock()89 virtual void ProcessBlock() {} 90 91 private: 92 93 }; 94 95 96 }} // namespace nn::crypto 97 98 #endif // __cplusplus 99 100 101 #endif /* NN_CRYPTO_CRYPTO_HASHCONTEXTBASE_H_ */ 102