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