01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.harmony.security.provider.crypto;
21:
22: /**
23: * This interface contains : <BR>
24: * - a set of constant values, H0-H4, defined in "SECURE HASH STANDARD", FIPS PUB 180-2 ;<BR>
25: * - implementation constant values to use in classes using SHA-1 algorithm. <BR>
26: */
27:
28: public interface SHA1_Data {
29:
30: /**
31: * constant defined in "SECURE HASH STANDARD"
32: */
33: static final int H0 = 0x67452301;
34:
35: /**
36: * constant defined in "SECURE HASH STANDARD"
37: */
38: static final int H1 = 0xEFCDAB89;
39:
40: /**
41: * constant defined in "SECURE HASH STANDARD"
42: */
43: static final int H2 = 0x98BADCFE;
44:
45: /**
46: * constant defined in "SECURE HASH STANDARD"
47: */
48: static final int H3 = 0x10325476;
49:
50: /**
51: * constant defined in "SECURE HASH STANDARD"
52: */
53: static final int H4 = 0xC3D2E1F0;
54:
55: /**
56: * offset in buffer to store number of bytes in 0-15 word frame
57: */
58: static final int BYTES_OFFSET = 81;
59:
60: /**
61: * offset in buffer to store current hash value
62: */
63: static final int HASH_OFFSET = 82;
64:
65: /**
66: * # of bytes in H0-H4 words; <BR>
67: * in this implementation # is set to 20 (in general # varies from 1 to 20)
68: */
69: static final int DIGEST_LENGTH = 20;
70:
71: /**
72: * name of native library to use on Windows platform
73: */
74: static final String LIBRARY_NAME = "hysecurity"; //$NON-NLS-1$
75:
76: /**
77: * names of random devices on Linux platform
78: */
79: static final String DEVICE_NAMES[] = {
80: "/dev/urandom", "/dev/random" }; //$NON-NLS-1$ //$NON-NLS-2$
81: }
|