diff -r 000000000000 -r 96e5fb8b040d kernel/eka/debug/crashMonitor/src/scmchksum.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kernel/eka/debug/crashMonitor/src/scmchksum.cpp Thu Dec 17 09:24:54 2009 +0200 @@ -0,0 +1,168 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// e32\debug\crashMonitor\src\scmchksum.cpp +// +// + +/** + @file + @internalTechnology +*/ + +#include + +namespace Debug + { + /** + * Constructor + */ + TScmChecksum::TScmChecksum() + : iLength(0) + , iSum(0) + , iZeroCount(0) + { + } + + /** + * ChecksumBlock - calculate checksum values for given data + * @param aData - the data to checksum + * @param aLen - the length of the data to checksum + * @return void + */ + void TScmChecksum::ChecksumBlock(const TUint8* aData, TUint aLen) + { + /** + * + * Note there is Symbian CRC implementation to be found in the following + * \src\cedar\generic\tools\e32tools\elf2e32\source\checksum.h + * \src\cedar\generic\tools\e32tools\elf2e32\source\checksum.cpp + * this however may be no good to us + * as we need to produce a single checksum even though the entire data may be + * read in different size blocks - and the entire data may not be available + * (the comm port requirement is for read only ) + * If we do however want to use the CRC then this is the place to insert the code + */ + if(!aData) + { + return; + } + + for(TUint i=0;i