2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSecCrypto_SkipJackCore.h
20 * @brief This header file contains declarations of SkipJack Core encryption and decryption algorithms.
22 #ifndef _FSEC_CRYPTO_INTERNAL_SKIPJACKCORE_H_
23 #define _FSEC_CRYPTO_INTERNAL_SKIPJACKCORE_H_
25 static const int _SKIPJACK_BLOCK_DATA_SIZE = 8;
26 static const int _SKIPJACK_KEY_LENGTH = 10; // Key length is 10 bytes
29 namespace Tizen { namespace Security { namespace Crypto
35 byte iv[_SKIPJACK_BLOCK_DATA_SIZE];
36 byte keyVal[_SKIPJACK_KEY_LENGTH];
43 static void DoCipherCbc(const byte* pIn, byte* pOut, long length, SkipJackKey& ks, const byte* pIv, bool encFlag);
44 static void DoCipherEcb(const byte* pIn, byte* pOut, SkipJackKey& key, bool encFlag);
45 static void Encrypt(unsigned long* pData, SkipJackKey& key);
46 static void Decrypt(unsigned long* pData, SkipJackKey& key);
50 _SkipJackCore(const _SkipJackCore& rhs);
51 _SkipJackCore& operator =(const _SkipJackCore& rhs);
56 } } } //Tizen::Security::Crypto
58 #endif //_FSEC_CRYPTO_INTERNAL_SKIPJACKCORE_H_