1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: crypto_Decryptor.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 #ifndef NN_CRYPTO_CRYPTO_DECRYPTOR_H_ 17 #define NN_CRYPTO_CRYPTO_DECRYPTOR_H_ 18 19 #include <nn/crypto/crypto_BlockCipher.h> 20 #include <nn/crypto/crypto_CipherMode.h> 21 22 23 namespace nn { 24 namespace crypto { 25 26 27 28 /* Please see man pages for details 29 30 31 32 33 34 35 36 37 38 39 */ 40 class Decryptor : public CipherMode 41 { 42 public: Decryptor()43 Decryptor(){} ~Decryptor()44 virtual ~Decryptor(){} 45 46 /* Please see man pages for details 47 48 49 50 51 52 53 54 55 56 57 58 */ 59 virtual void Initialize(const BlockCipher& c, const void* pIv, size_t ivSize) = 0; 60 61 /* Please see man pages for details 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 */ 100 virtual size_t Update(void* pDst, size_t dstSize, const void* pSrc, size_t srcSize) = 0; 101 102 /* Please see man pages for details 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 */ 124 virtual size_t UpdateFinal(void* pDst, size_t dstSize) = 0; 125 126 protected: 127 size_t Decrypt(void* pDst, size_t dstSize, const void* pSrc, size_t srcSize, 128 const void* pIv, size_t ivSize, const BlockCipher& c); 129 }; 130 131 132 133 } // namespace crypto 134 } // namespace nn 135 136 137 138 #endif /* NN_CRYPTO_CRYPTO_DECRYPTOR_H_ */ 139