1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: crypto_ShaBlock512BitContext.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 API declaration concerning SHA-X (Blocksize = 512bit) 18 */ 19 20 #ifndef NN_CRYPTO_CRYPTO_SHABLOCK512BITCONTEXT_H_ 21 #define NN_CRYPTO_CRYPTO_SHABLOCK512BITCONTEXT_H_ 22 23 #include <nn/crypto/crypto_HashContextBase.h> 24 25 #ifdef __cplusplus 26 27 namespace nn{ namespace crypto{ 28 29 /* Please see man pages for details 30 31 32 33 34 35 36 */ 37 class ShaBlock512BitContext : public HashContextBase 38 { 39 public: 40 static const size_t BLOCK_SIZE = (512/8); // 512bit 41 42 virtual void Update(const void* pData, size_t size); InitializeWithContext(const void *,u64)43 virtual void InitializeWithContext(const void*, u64) {}; 44 45 protected: 46 u8 m_Block[BLOCK_SIZE]; 47 u32 m_Pool; 48 u32 m_BlocksLow; 49 u32 m_BlocksHigh; 50 51 void AddPadding(); ProcessBlock()52 virtual void ProcessBlock() {} 53 54 // Prohibit individual instantiation ShaBlock512BitContext()55 ShaBlock512BitContext() {} ~ShaBlock512BitContext()56 virtual ~ShaBlock512BitContext() {} 57 }; 58 59 }} // namespace nn::crypto 60 61 #endif // __cplusplus 62 63 64 #endif /* NN_CRYPTO_CRYPTO_SHABLOCK512BITCONTEXT_H_ */ 65