1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: crypto_HashContextBase.h 4 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 $Rev: 34562 $ 11 *--------------------------------------------------------------------------- 12 13 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 class HashContextBase 34 { 35 public: 36 37 /* 38 39 40 41 */ Initialize()42 virtual void Initialize() {} 43 44 /* 45 46 47 48 */ Finalize()49 virtual void Finalize() {} 50 51 /* 52 53 54 55 */ Update(const void * pData,size_t length)56 virtual void Update(const void* pData, size_t length) 57 { 58 NN_UNUSED_VAR(pData); 59 NN_UNUSED_VAR(length); 60 } 61 62 /* 63 64 65 66 */ GetHashLength()67 virtual size_t GetHashLength() { return 0; } 68 69 /* 70 71 72 73 */ GetHash(void * pOut)74 virtual void GetHash(void* pOut) 75 { 76 NN_UNUSED_VAR(pOut); 77 } 78 79 protected: 80 81 // Prohibit independent instantiation HashContextBase()82 HashContextBase() {} ~HashContextBase()83 virtual ~HashContextBase() {} 84 85 // Process block internally ProcessBlock()86 virtual void ProcessBlock() {} 87 88 private: 89 90 }; 91 92 93 }} // namespace nn::crypto 94 95 #endif // __cplusplus 96 97 98 #endif /* NN_CRYPTO_CRYPTO_HASHCONTEXTBASE_H_ */ 99