1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     crypto_Cipher.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 #ifndef NN_CRYPTO_CRYPTO_CIPHER_H_
18 #define NN_CRYPTO_CRYPTO_CIPHER_H_
19 
20 namespace nn {
21 namespace crypto {
22 
23     /* Please see man pages for details
24 
25 
26 
27 
28 
29 
30 
31 
32     */
33     const size_t ENCRYPT_HEADER_SIZE = 16;
34 
35     /* Please see man pages for details
36 
37 
38 
39 
40 
41 
42 
43 
44     */
45     const size_t GENERATE_HEADER_SIZE = 32;
46 
47     /* Please see man pages for details
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68     */
69     void EncryptAes128Ctr(void* pDst, const void* pSrc, size_t srcSize, const void* pKey);
70 
71     /* Please see man pages for details
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88     */
89     void DecryptAes128Ctr(void* pDst, const void* pSrc, size_t srcSize, const void* pKey);
90 
91 
92 
93     /* Please see man pages for details
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114     */
115     void EncryptAndGenerateAes128Ccm(void* pDst, const void* pSrc, size_t srcSize, const void* pKey);
116 
117     /* Please see man pages for details
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138     */
139     bool DecryptAndVerifyAes128Ccm(void* pDst, const void* pSrc, size_t srcSize, const void* pKey);
140 
141 
142 
143     /* Please see man pages for details
144 
145 
146 
147 
148     */
149     void GenerateRandomBytes(void* pDst, size_t size);
150 
151 }
152 }
153 
154 #endif /* NN_CRYPTO_CRYPTO_CIPHER_H_ */
155