Save This Page
Home » crypto-143 » org.bouncycastle.crypto » [javadoc | source]
    1   /*
    2   Copyright (c) 2000 The Legion Of The Bouncy Castle
    3   (http://www.bouncycastle.org)
    4   
    5   Permission is hereby granted, free of charge, to any person obtaining
    6   a copy of this software and associated documentation files (the "Software"),
    7   to deal in the Software without restriction, including without limitation
    8   the rights to use, copy, modify, merge, publish, distribute, sublicense,
    9   and/or sell copies of the Software, and to permit persons to whom the Software
   10   is furnished to do so, subject to the following conditions:
   11   
   12   The above copyright notice and this permission notice shall be included in all
   13   copies or substantial portions of the Software. 
   14   
   15   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   16   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   17   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   18   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   19   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   20   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
   21   THE SOFTWARE. 
   22   */
   23   package org.bouncycastle.crypto;
   24   
   25   /**
   26    * interface that a message digest conforms to.
   27    */
   28   public interface Digest
   29   {
   30       /**
   31        * return the algorithm name
   32        *
   33        * @return the algorithm name
   34        */
   35       public String getAlgorithmName();
   36   
   37       /**
   38        * return the size, in bytes, of the digest produced by this message digest.
   39        *
   40        * @return the size, in bytes, of the digest produced by this message digest.
   41        */
   42   	public int getDigestSize();
   43   
   44       /**
   45        * update the message digest with a single byte.
   46        *
   47        * @param in the input byte to be entered.
   48        */
   49   	public void update(byte in);
   50   
   51       /**
   52        * update the message digest with a block of bytes.
   53        *
   54        * @param in the byte array containing the data.
   55        * @param inOff the offset into the byte array where the data starts.
   56        * @param len the length of the data.
   57        */
   58   	public void update(byte[] in, int inOff, int len);
   59   
   60       /**
   61        * close the digest, producing the final digest value. The doFinal
   62        * call leaves the digest reset.
   63        *
   64        * @param out the array the digest is to be copied into.
   65        * @param outOff the offset into the out array the digest is to start at.
   66        */
   67   	public int doFinal(byte[] out, int outOff);
   68   
   69       /**
   70        * reset the digest back to it's initial state.
   71        */
   72       public void reset();
   73   }

Save This Page
Home » crypto-143 » org.bouncycastle.crypto » [javadoc | source]