Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


oracle.stellent.wcm.common.encode
Class Sha1

java.lang.Object
  extended by oracle.stellent.wcm.common.encode.Sha1


public final class Sha1
extends java.lang.Object

Note: this code is based on the code supplied gotten from Chuck McManis created on 5 Oct 1996 from the URL http://professionals.com/~cmcmanis//java/ Based on the C code that Steve Reid wrote his header was : SHA-1 in C By Steve Reid <steve@edmweb.com> 100% Public Domain Test Vectors (from FIPS PUB 180-1) "abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F This is a simple port of Steve Reid's SHA-1 code into Java. I've run his test vectors through the code and they all pass.


Field Summary
protected  int[] m_block
           
protected  int m_blockIndex
           
protected  long m_count
           
protected  int[] m_dd
          Working variables.
 byte[] m_digestBits
           
 boolean m_digestValid
           
protected  int[] m_state
           

 

Constructor Summary
Sha1()
           

 

Method Summary
 void computeDigest(byte[] source)
          Complete digest computation on an array of bytes.
 void finish()
          Complete processing on the message digest.
 void init()
          Initialize new context
 void update(byte b)
          Add one byte to the digest.
 void update(byte[] input)
          Add an array of bytes to the digest.
 void update(byte[] input, int offset, int len)
          Add specific bytes to the digest.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

m_digestBits

public byte[] m_digestBits

m_digestValid

public boolean m_digestValid

m_state

protected int[] m_state

m_count

protected long m_count

m_block

protected int[] m_block

m_blockIndex

protected int m_blockIndex

m_dd

protected int[] m_dd
Working variables.

Constructor Detail

Sha1

public Sha1()

Method Detail

update

public void update(byte[] input,
                   int offset,
                   int len)
Add specific bytes to the digest.

update

public void update(byte[] input)
Add an array of bytes to the digest.

computeDigest

public void computeDigest(byte[] source)
Complete digest computation on an array of bytes.

init

public void init()
Initialize new context

update

public void update(byte b)
Add one byte to the digest. When this is implemented all of the abstract class methods end up calling this method for types other than bytes.

finish

public void finish()
Complete processing on the message digest.

Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved.