View Javadoc
1   package org.bouncycastle.crypto;
2   
3   /*-
4    * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5    * SNMP Java Client
6    * ჻჻჻჻჻჻
7    * Copyright 2023 MetricsHub, Westhawk
8    * ჻჻჻჻჻჻
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
23   */
24  
25  /**
26   * interface that a message digest conforms to.
27   */
28  public interface Digest {
29      /**
30       * return the algorithm name
31       *
32       * @return the algorithm name
33       */
34      public String getAlgorithmName();
35  
36      /**
37       * return the size, in bytes, of the digest produced by this message digest.
38       *
39       * @return the size, in bytes, of the digest produced by this message digest.
40       */
41      public int getDigestSize();
42  
43      /**
44       * update the message digest with a single byte.
45       *
46       * @param in the input byte to be entered.
47       */
48      public void update(byte in);
49  
50      /**
51       * update the message digest with a block of bytes.
52       *
53       * @param in the byte array containing the data.
54       * @param inOff the offset into the byte array where the data starts.
55       * @param len the length of the data.
56       */
57      public void update(byte[] in, int inOff, int len);
58  
59      /**
60       * close the digest, producing the final digest value. The doFinal
61       * call leaves the digest reset.
62       *
63       * @param out the array the digest is to be copied into.
64       * @param outOff the offset into the out array the digest is to start at.
65       */
66      public int doFinal(byte[] out, int outOff);
67  
68      /**
69       * reset the digest back to it's initial state.
70       */
71      public void reset();
72  }