Coverage Summary for Class: Keccak256 (org.ethereum.crypto.cryptohash)
Class |
Class, %
|
Method, %
|
Line, %
|
Keccak256 |
100%
(1/1)
|
66.7%
(2/3)
|
75%
(3/4)
|
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2017 RSK Labs Ltd.
4 * (derived from ethereumJ library, Copyright (c) 2016 <ether.camp>)
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 // $Id: Keccak256.java 189 2010-05-14 21:21:46Z tp $
21
22 package org.ethereum.crypto.cryptohash;
23
24 /**
25 * <p>This class implements the Keccak-256 digest algorithm under the
26 * {@link org.ethereum.crypto.cryptohash.Digest} API.</p>
27 *
28 * <pre>
29 * ==========================(LICENSE BEGIN)============================
30 *
31 * Copyright (c) 2007-2010 Projet RNRT SAPHIR
32 *
33 * Permission is hereby granted, free of charge, to any person obtaining
34 * a copy of this software and associated documentation files (the
35 * "Software"), to deal in the Software without restriction, including
36 * without limitation the rights to use, copy, modify, merge, publish,
37 * distribute, sublicense, and/or sell copies of the Software, and to
38 * permit persons to whom the Software is furnished to do so, subject to
39 * the following conditions:
40 *
41 * The above copyright notice and this permission notice shall be
42 * included in all copies or substantial portions of the Software.
43 *
44 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
45 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51 *
52 * ===========================(LICENSE END)=============================
53 * </pre>
54 *
55 * @version $Revision: 189 $
56 * @author Thomas Pornin <thomas.pornin@cryptolog.com>
57 */
58
59 public class Keccak256 extends KeccakCore {
60
61 /**
62 * Create the engine.
63 */
64 public Keccak256()
65 {
66 }
67
68 /** @see org.ethereum.crypto.cryptohash.Digest */
69 public Digest copy()
70 {
71 return copyState(new Keccak256());
72 }
73
74 /** @see org.ethereum.crypto.cryptohash.Digest */
75 public int getDigestLength()
76 {
77 return 32;
78 }
79 }