whirlpool.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "whirlpool.h"

Include dependency graph for whirlpool.c:

Go to the source code of this file.

Defines

#define R   10

Functions

static void processBuffer (struct NESSIEstruct *const structpointer)
void NESSIEinit (struct NESSIEstruct *const structpointer)
void NESSIEadd (const unsigned char *const source, unsigned long sourceBits, struct NESSIEstruct *const structpointer)
void NESSIEfinalize (struct NESSIEstruct *const structpointer, unsigned char *const result)

Variables

static const u64 C0 [256]
static const u64 C1 [256]
static const u64 C2 [256]
static const u64 C3 [256]
static const u64 C4 [256]
static const u64 C5 [256]
static const u64 C6 [256]
static const u64 C7 [256]
static const u64 rc [R+1]


Define Documentation

#define R   10
 

The Whirlpool hashing function.

References

The Whirlpool algorithm was developed by Paulo S. L. M. Barreto and Vincent Rijmen.

See P.S.L.M. Barreto, V. Rijmen, ``The Whirlpool hashing function,'' NESSIE submission, 2000 (tweaked version, 2001), <https://www.cosic.esat.kuleuven.ac.be/nessie/workshop/submissions/whirlpool.zip>

Author:
Paulo S.L.M. Barreto

Vincent Rijmen.

Version:
3.0 (2003.03.12)
=============================================================================

Differences from version 2.1:

  • Suboptimal diffusion matrix replaced by cir(1, 1, 4, 1, 8, 5, 2, 9).

=============================================================================

Differences from version 2.0:

  • Generation of ISO/IEC 10118-3 test vectors.
  • Bug fix: nonzero carry was ignored when tallying the data length (this bug apparently only manifested itself when feeding data in pieces rather than in a single chunk at once).
  • Support for MS Visual C++ 64-bit integer arithmetic.

Differences from version 1.0:

  • Original S-box replaced by the tweaked, hardware-efficient version.

=============================================================================

THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition at line 73 of file whirlpool.c.


Function Documentation

void NESSIEadd const unsigned char *const   source,
unsigned long  sourceBits,
struct NESSIEstruct *const   structpointer
 

Delivers input data to the hashing algorithm.

Parameters:
source plaintext data to hash.
sourceBits how many bits of plaintext to process.
This method maintains the invariant: bufferBits < DIGESTBITS

Definition at line 1518 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, LL, and value.

Referenced by cryptfunctionvalue().

void NESSIEfinalize struct NESSIEstruct *const   structpointer,
unsigned char *const   result
 

Get the hash value from the hashing state.

This method uses the invariant: bufferBits < DIGESTBITS

Definition at line 1636 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, DIGESTBYTES, NESSIEstruct::hash, LENGTHBYTES, processBuffer(), and WBLOCKBYTES.

Referenced by cryptfunctionvalue().

Here is the call graph for this function:

void NESSIEinit struct NESSIEstruct *const   structpointer  ) 
 

Initialize the hashing state.

Definition at line 1482 of file whirlpool.c.

References NESSIEstruct::bitLength, NESSIEstruct::buffer, NESSIEstruct::bufferBits, NESSIEstruct::bufferPos, and NESSIEstruct::hash.

Referenced by cryptfunctionvalue().

static void processBuffer struct NESSIEstruct *const   structpointer  )  [static]
 

The core Whirlpool transform.

Definition at line 1173 of file whirlpool.c.

References block, NESSIEstruct::buffer, i, r, and WBLOCKBYTES.

Referenced by NESSIEfinalize().


Variable Documentation

const u64 C0[256] [static]
 

Definition at line 82 of file whirlpool.c.

const u64 C1[256] [static]
 

Definition at line 149 of file whirlpool.c.

const u64 C2[256] [static]
 

Definition at line 216 of file whirlpool.c.

const u64 C3[256] [static]
 

Definition at line 283 of file whirlpool.c.

const u64 C4[256] [static]
 

Definition at line 350 of file whirlpool.c.

const u64 C5[256] [static]
 

Definition at line 417 of file whirlpool.c.

const u64 C6[256] [static]
 

Definition at line 484 of file whirlpool.c.

const u64 C7[256] [static]
 

Definition at line 551 of file whirlpool.c.

const u64 rc[R+1] [static]
 

Initial value:

 {
    LL(0x0000000000000000),
    LL(0x1823c6e887b8014f),
    LL(0x36a6d2f5796f9152),
    LL(0x60bc9b8ea30c7b35),
    LL(0x1de0d7c22e4bfe57),
    LL(0x157737e59ff04ada),
    LL(0x58c9290ab1a06b85),
    LL(0xbd5d10f4cb3e0567),
    LL(0xe427418ba77d95d8),
    LL(0xfbee7c66dd17479e),
    LL(0xca2dbf07ad5a8333),
}

Definition at line 1156 of file whirlpool.c.

Referenced by centerdialog(), pcre_exec(), and pcre_get_stringnumber().


Generated on Wed Jun 14 04:24:13 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6