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 public final class SHA1Constants {
SHA1Constants()32     private SHA1Constants() {
33     }
34 
35     /**
36      *  constant defined in "SECURE HASH STANDARD"
37      */
38     public static final int H0 = 0x67452301;
39 
40 
41     /**
42      *  constant defined in "SECURE HASH STANDARD"
43      */
44     public static final int H1 = 0xEFCDAB89;
45 
46 
47     /**
48      *  constant defined in "SECURE HASH STANDARD"
49      */
50     public static final int H2 = 0x98BADCFE;
51 
52 
53     /**
54      *  constant defined in "SECURE HASH STANDARD"
55      */
56     public static final int H3 = 0x10325476;
57 
58 
59     /**
60      *  constant defined in "SECURE HASH STANDARD"
61      */
62     public static final int H4 = 0xC3D2E1F0;
63 
64 
65     /**
66      * offset in buffer to store number of bytes in 0-15 word frame
67      */
68     public static final int BYTES_OFFSET = 81;
69 
70 
71     /**
72      * offset in buffer to store current hash value
73      */
74     public static final int HASH_OFFSET = 82;
75 
76 
77     /**
78      * # of bytes in H0-H4 words; <BR>
79      * in this implementation # is set to 20 (in general # varies from 1 to 20)
80      */
81     public static final int DIGEST_LENGTH = 20;
82 }
83