View Javadoc
1   package org.bouncycastle.crypto;
2   
3   /*-
4    * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5    * SNMP Java Client
6    * ჻჻჻჻჻჻
7    * Copyright 2023 Sentry Software, 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      /**
31       * return the algorithm name
32       *
33       * @return the algorithm name
34       */
35      public String getAlgorithmName();
36  
37      /**
38       * return the size, in bytes, of the digest produced by this message digest.
39       *
40       * @return the size, in bytes, of the digest produced by this message digest.
41       */
42      public int getDigestSize();
43  
44      /**
45       * update the message digest with a single byte.
46       *
47       * @param in the input byte to be entered.
48       */
49      public void update(byte in);
50  
51      /**
52       * update the message digest with a block of bytes.
53       *
54       * @param in the byte array containing the data.
55       * @param inOff the offset into the byte array where the data starts.
56       * @param len the length of the data.
57       */
58      public void update(byte[] in, int inOff, int len);
59  
60      /**
61       * close the digest, producing the final digest value. The doFinal
62       * call leaves the digest reset.
63       *
64       * @param out the array the digest is to be copied into.
65       * @param outOff the offset into the out array the digest is to start at.
66       */
67      public int doFinal(byte[] out, int outOff);
68  
69      /**
70       * reset the digest back to it's initial state.
71       */
72      public void reset();
73  }