Home | History | Annotate | Download | only in crypto
      1 /*
      2  *  Licensed to the Apache Software Foundation (ASF) under one or more
      3  *  contributor license agreements.  See the NOTICE file distributed with
      4  *  this work for additional information regarding copyright ownership.
      5  *  The ASF licenses this file to You under the Apache License, Version 2.0
      6  *  (the "License"); you may not use this file except in compliance with
      7  *  the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  */
     17 /**
     18 * @author Yuri A. Kropachev
     19 * @version $Revision$
     20 */
     21 
     22 
     23 package org.apache.harmony.security.provider.crypto;
     24 
     25 
     26 /**
     27  * This interface contains : <BR>
     28  * - a set of constant values, H0-H4, defined in "SECURE HASH STANDARD", FIPS PUB 180-2 ;<BR>
     29  * - implementation constant values to use in classes using SHA-1 algorithm.    <BR>
     30  */
     31 
     32 
     33 public interface SHA1_Data {
     34 
     35 
     36     /**
     37      *  constant defined in "SECURE HASH STANDARD"
     38      */
     39     static final int H0 = 0x67452301;
     40 
     41 
     42     /**
     43      *  constant defined in "SECURE HASH STANDARD"
     44      */
     45     static final int H1 = 0xEFCDAB89;
     46 
     47 
     48     /**
     49      *  constant defined in "SECURE HASH STANDARD"
     50      */
     51     static final int H2 = 0x98BADCFE;
     52 
     53 
     54     /**
     55      *  constant defined in "SECURE HASH STANDARD"
     56      */
     57     static final int H3 = 0x10325476;
     58 
     59 
     60     /**
     61      *  constant defined in "SECURE HASH STANDARD"
     62      */
     63     static final int H4 = 0xC3D2E1F0;
     64 
     65 
     66     /**
     67      * offset in buffer to store number of bytes in 0-15 word frame
     68      */
     69     static final int BYTES_OFFSET = 81;
     70 
     71 
     72     /**
     73      * offset in buffer to store current hash value
     74      */
     75     static final int HASH_OFFSET = 82;
     76 
     77 
     78     /**
     79      * # of bytes in H0-H4 words; <BR>
     80      * in this implementation # is set to 20 (in general # varies from 1 to 20)
     81      */
     82     static final int DIGEST_LENGTH = 20;
     83 }
     84