1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     crypto_BlockCipher.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_BLOCKCIPHER_
17 #define NN_CRYPTO_CRYPTO_BLOCKCIPHER_
18 
19 #include <nn/types.h>
20 
21 
22 namespace nn {
23 namespace crypto {
24 
25 
26 
27 /* Please see man pages for details
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 */
39 class BlockCipher
40 {
41 public:
BlockCipher()42     BlockCipher(){}
~BlockCipher()43     virtual ~BlockCipher(){}
44 
45     /* Please see man pages for details
46 
47 
48 
49 
50 
51     */
52     virtual size_t GetBlockSize() const = 0;
53 
54     /* Please see man pages for details
55 
56 
57 
58 
59 
60     */
61     virtual size_t GetKeySize()   const = 0;
62 
63 
64 
65     /* Please see man pages for details
66 
67 
68 
69 
70 
71 
72     */
73     virtual void SetKey(const void* pKey, size_t keySize) = 0;
74 
75 
76 
77     /* Please see man pages for details
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90     */
91     virtual void Encrypt(void* pDst, const void* pSrc) const = 0;
92 
93     /* Please see man pages for details
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106     */
107     virtual void Decrypt(void* pDst, const void* pSrc) const = 0;
108 };
109 
110 
111 
112 }   // namespace crypto
113 }   // namespace nn
114 
115 
116 
117 #endif /* NN_CRYPTO_CRYPTO_BLOCKCIPHER_ */
118