01: package org.bouncycastle.crypto;
02:
03: /**
04: * interface that a message digest conforms to.
05: */
06: public interface Digest {
07: /**
08: * return the algorithm name
09: *
10: * @return the algorithm name
11: */
12: public String getAlgorithmName();
13:
14: /**
15: * return the size, in bytes, of the digest produced by this message digest.
16: *
17: * @return the size, in bytes, of the digest produced by this message digest.
18: */
19: public int getDigestSize();
20:
21: /**
22: * update the message digest with a single byte.
23: *
24: * @param in the input byte to be entered.
25: */
26: public void update(byte in);
27:
28: /**
29: * update the message digest with a block of bytes.
30: *
31: * @param in the byte array containing the data.
32: * @param inOff the offset into the byte array where the data starts.
33: * @param len the length of the data.
34: */
35: public void update(byte[] in, int inOff, int len);
36:
37: /**
38: * close the digest, producing the final digest value. The doFinal
39: * call leaves the digest reset.
40: *
41: * @param out the array the digest is to be copied into.
42: * @param outOff the offset into the out array the digest is to start at.
43: */
44: public int doFinal(byte[] out, int outOff);
45:
46: /**
47: * reset the digest back to it's initial state.
48: */
49: public void reset();
50: }
|