crypto/weakcrypto/test/tasymmetric/tsignatureinput.cpp
changeset 0 2c201484c85f
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2005-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 
       
    20 
       
    21 /**
       
    22  @file
       
    23 */
       
    24 
       
    25 #include "tsignatureinput.h"
       
    26 
       
    27 /* CHashingSignatureInput */
       
    28 
       
    29 CHashingSignatureInput* CHashingSignatureInput::NewL(
       
    30     CMessageDigest::THashId aHashId)
       
    31     {
       
    32     CHashingSignatureInput* self = NewLC(aHashId);
       
    33     CleanupStack::Pop(self);
       
    34     return self;
       
    35     }
       
    36 
       
    37 CHashingSignatureInput* CHashingSignatureInput::NewLC(
       
    38     CMessageDigest::THashId aHashId)
       
    39     {
       
    40     CHashingSignatureInput* self = new(ELeave)CHashingSignatureInput;
       
    41     CleanupStack::PushL(self);
       
    42     self->ConstructL(aHashId);
       
    43     return self;
       
    44     }
       
    45 
       
    46 void CHashingSignatureInput::Update(const TDesC8& aInput)
       
    47     {
       
    48     iHash->Update(aInput);
       
    49     }
       
    50 
       
    51 TPtrC8 CHashingSignatureInput::Final(void)
       
    52     {
       
    53     return iHash->Final();
       
    54     }
       
    55 
       
    56 CHashingSignatureInput::CHashingSignatureInput(void)
       
    57     {
       
    58     }
       
    59 
       
    60 CHashingSignatureInput::~CHashingSignatureInput(void)
       
    61     {
       
    62     delete iHash;
       
    63     }
       
    64 
       
    65 void CHashingSignatureInput::ConstructL(CMessageDigest::THashId aHashId)
       
    66     {
       
    67     iHash = CMessageDigestFactory::NewDigestL(aHashId);
       
    68     }