crypto/weakcryptospi/source/symmetric/3des.cpp
changeset 19 cd501b96611d
equal deleted inserted replaced
15:da2ae96f639b 19:cd501b96611d
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "3des.h"
       
    20 #include "3desshim.h"
       
    21 
       
    22 const TInt K3DESBlockBytes = 8;
       
    23 const TInt K3DESKeyBytes = 24;
       
    24 
       
    25 C3DES::C3DES()
       
    26 	{
       
    27 	}
       
    28 
       
    29 /* C3DESEncryptor */
       
    30 EXPORT_C C3DESEncryptor* C3DESEncryptor::NewL(const TDesC8& aKey)
       
    31 	{
       
    32 	return C3DESEncryptorShim::NewL(aKey);
       
    33 	}
       
    34 
       
    35 EXPORT_C C3DESEncryptor* C3DESEncryptor::NewLC(const TDesC8& aKey)
       
    36 	{
       
    37 	return C3DESEncryptorShim::NewLC(aKey);
       
    38 	}
       
    39 
       
    40 /* C3DESDecryptor */
       
    41 EXPORT_C C3DESDecryptor* C3DESDecryptor::NewL(const TDesC8& aKey)
       
    42 	{
       
    43 	return C3DESDecryptorShim::NewL(aKey);
       
    44 	}
       
    45 
       
    46 EXPORT_C C3DESDecryptor* C3DESDecryptor::NewLC(const TDesC8& aKey)
       
    47 	{
       
    48 	return C3DESDecryptorShim::NewLC(aKey);
       
    49 	}
       
    50 	
       
    51 // All these methods have been replaced by the shim
       
    52 #ifdef _BullseyeCoverage
       
    53 #pragma suppress_warnings on
       
    54 #pragma BullseyeCoverage off
       
    55 #pragma suppress_warnings off
       
    56 #endif
       
    57 
       
    58 void C3DES::Transform(TDes8& /*aBlock*/)
       
    59 	{
       
    60 	// Method replaced by shim 
       
    61 	ASSERT(EFalse);		
       
    62 	}
       
    63 	
       
    64 void C3DES::Reset()
       
    65 	{
       
    66 	// Method replaced by shim 
       
    67 	ASSERT(EFalse);			
       
    68 	}
       
    69 	
       
    70 TInt C3DES::BlockSize() const
       
    71 	{
       
    72 	// Method replaced by shim 
       
    73 	ASSERT(EFalse);
       
    74 	return K3DESBlockBytes;			
       
    75 	}	
       
    76 
       
    77 TInt C3DES::KeySize() const
       
    78 	{
       
    79 	// Method replaced by shim 
       
    80 	ASSERT(EFalse);
       
    81 	return K3DESKeyBytes;		
       
    82 	}
       
    83 	
       
    84 void C3DES::DoSetKey(const TDesC8& /*aKey*/)
       
    85 	{
       
    86 	// Method replaced by shim 
       
    87 	ASSERT(EFalse);				
       
    88 	}
       
    89 	
       
    90 void C3DES::ConstructL(const TDesC8& /*aKey*/)
       
    91 	{
       
    92 	// Method replaced by shim 
       
    93 	ASSERT(EFalse);			
       
    94 	}	
       
    95 
       
    96 void C3DESEncryptor::DoSetKey(const TDesC8& /*aKey*/)
       
    97 	{
       
    98 	// Method replaced by shim 
       
    99 	ASSERT(EFalse);				
       
   100 	}	
       
   101 
       
   102 void C3DESDecryptor::DoSetKey(const TDesC8& /*aKey*/)
       
   103 	{
       
   104 	// Method replaced by shim 
       
   105 	ASSERT(EFalse);				
       
   106 	}