os/security/crypto/weakcrypto/test/tasymmetric/tsignatureinput.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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  @file
    21 */
    22 
    23 #include "tsignatureinput.h"
    24 
    25 /* CHashingSignatureInput */
    26 
    27 CHashingSignatureInput* CHashingSignatureInput::NewL(
    28     CMessageDigest::THashId aHashId)
    29     {
    30     CHashingSignatureInput* self = NewLC(aHashId);
    31     CleanupStack::Pop(self);
    32     return self;
    33     }
    34 
    35 CHashingSignatureInput* CHashingSignatureInput::NewLC(
    36     CMessageDigest::THashId aHashId)
    37     {
    38     CHashingSignatureInput* self = new(ELeave)CHashingSignatureInput;
    39     CleanupStack::PushL(self);
    40     self->ConstructL(aHashId);
    41     return self;
    42     }
    43 
    44 void CHashingSignatureInput::Update(const TDesC8& aInput)
    45     {
    46     iHash->Update(aInput);
    47     }
    48 
    49 TPtrC8 CHashingSignatureInput::Final(void)
    50     {
    51     return iHash->Final();
    52     }
    53 
    54 CHashingSignatureInput::CHashingSignatureInput(void)
    55     {
    56     }
    57 
    58 CHashingSignatureInput::~CHashingSignatureInput(void)
    59     {
    60     delete iHash;
    61     }
    62 
    63 void CHashingSignatureInput::ConstructL(CMessageDigest::THashId aHashId)
    64     {
    65     iHash = CMessageDigestFactory::NewDigestL(aHashId);
    66     }
    67