1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: crypto_ShaBlock512BitContext.h 4 5 Copyright (C)2009 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: 12449 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* 17 SHA-X (Blocksize = 512bit) に関する API の宣言 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 /*! 30 @brief SHA(BlockSize=512bit)計算用コンテキストオブジェクトです。 31 32 このクラスを直接インスタンス化することはできません。 33 継承先のクラスを使用してください。 34 */ 35 class ShaBlock512BitContext : public HashContextBase 36 { 37 public: 38 static const size_t BLOCK_SIZE = (512/8); // 512bit 39 40 virtual void Update(const void* pData, size_t length); 41 42 protected: 43 u8 m_Block[BLOCK_SIZE]; 44 u32 m_Pool; 45 u32 m_BlocksLow; 46 u32 m_BlocksHigh; 47 48 void Fill(u8 input, size_t length); 49 void AddPadding(); 50 51 // 単独インスタンス化の禁止 ShaBlock512BitContext()52 ShaBlock512BitContext() {} ~ShaBlock512BitContext()53 ~ShaBlock512BitContext() {} 54 }; 55 56 }} // namespace nn::crypto 57 58 #endif // __cplusplus 59 60 61 #endif /* NN_CRYPTO_CRYPTO_SHABLOCK512BITCONTEXT_H_ */ 62