Searched refs:digest (Results 1 - 19 of 19) sorted by relevance

/libcore/luni/src/main/java/java/security/
H A DDigestInputStream.java26 * associated message digest.
31 * The message digest for this stream.
33 protected MessageDigest digest; field in class:DigestInputStream
35 // Indicates whether digest functionality is on or off
40 * given {@code stream} and the {@code digest}.
47 * @param digest
48 * the message digest.
50 public DigestInputStream(InputStream stream, MessageDigest digest) { argument
52 this.digest = digest;
70 setMessageDigest(MessageDigest digest) argument
[all...]
H A DDigestOutputStream.java26 * associated message digest.
31 * The message digest for this stream.
33 protected MessageDigest digest; field in class:DigestOutputStream
35 // Indicates whether digest functionality is on or off
40 * given {@code stream} and the {@code digest}.
44 * @param digest
45 * the message digest.
47 public DigestOutputStream(OutputStream stream, MessageDigest digest) { argument
49 this.digest = digest;
67 setMessageDigest(MessageDigest digest) argument
[all...]
H A DMessageDigest.java26 * <i>message</i>, and the fixed-length byte sequence is the <i>digest</i> or
27 * <i>message digest</i>.
30 * <p>The basic pattern to digest an {@link java.io.InputStream} looks like this:
38 * byte[] digest = digester.digest();
42 * call {@link #update(byte[],int,int)} for each block of input data, and then call {@link #digest}
43 * to get the final digest. Note that calling {@code digest} resets the {@code MessageDigest}.
45 * calling {@code digest}.
228 * After the digest i
233 public byte[] digest() { method in class:MessageDigest
255 public int digest(byte[] buf, int offset, int len) throws DigestException { method in class:MessageDigest
276 public byte[] digest(byte[] input) { method in class:MessageDigest
[all...]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DDigestInputStream2Test.java33 MessageDigest digest; field in class:DigestInputStream2Test
42 DigestInputStream dis = new DigestInputStream(inStream, digest);
52 DigestInputStream dis = new DigestInputStream(inStream, digest);
53 assertEquals("getMessageDigest returned a bogus result", digest, dis
62 MessageDigest originalDigest = (MessageDigest) (digest.clone());
63 MessageDigest noChangeDigest = (MessageDigest) (digest.clone());
71 // make sure the digest for the part where it was off has not
74 MessageDigest.isEqual(noChangeDigest.digest(), originalDigest
75 .digest()));
76 MessageDigest changeDigest = (MessageDigest) (digest
[all...]
H A DMessageDigest2Test.java92 MessageDigest.isEqual(d1.digest(), d2.digest()));
153 byte[] hash = sha.digest(data);
196 byte[] hash = sha.digest(data);
201 * java.security.MessageDigest#digest()
207 byte[] digest = sha.digest();
208 assertTrue("bug in SHA", MessageDigest.isEqual(digest, MESSAGE_DIGEST));
215 digest = sha.digest();
[all...]
H A DDigestOutputStreamTest.java44 * Message digest algorithm name used during testing
60 * Test message for digest computations
105 MessageDigest digest = new MyMessageDigest1();
109 DigestOutputStream dos = new DigestOutputStream(out, digest);
110 assertSame(digest, dos.getMessageDigest());
122 MessageDigest digest = new MyMessageDigest1();
128 dos.setMessageDigest(digest);
129 assertSame(digest, dos.getMessageDigest());
141 * Assertion: updates associated digest<br>
155 // check that associated digest ha
605 MyDigestOutputStream(OutputStream out, MessageDigest digest) argument
[all...]
H A DMessageDigest1Test.java124 * java.security.MessageDigest#digest()
128 assertEquals("incorrect result", 0, md.digest().length);
133 * java.security.MessageDigest#digest(byte[])
138 assertEquals("incorrect result", 0, md.digest(b).length);
143 * java.security.MessageDigest#digest(byte[], int, int)
148 assertEquals("incorrect result", 0, md.digest(b, 2, 3));
149 assertTrue("digest failed", md.runEngineDigest);
156 md.digest(null, 0, 1);
162 md.digest(bytes, 0, bytes.length + 1);
168 md.digest(byte
[all...]
H A DDigestInputStreamTest.java44 * Message digest algorithm name used during testing
60 * Test message for digest computations
110 * Assertion: updates associated digest<br>
123 // check that associated digest has been updated properly
126 dis.getMessageDigest().digest(),
142 * Assertion: must not update digest if EOS had been
159 // check that 3 previous read() calls did not update digest
161 Arrays.equals(dis.getMessageDigest().digest(),
175 * Assertion: <code>read()</code> must not update digest if it is off<br>
176 * Assertion: <code>on(boolean)</code> turns digest functionalit
[all...]
/libcore/support/src/test/java/tests/security/
H A DMessageDigestTest.java33 private MessageDigest digest; field in class:MessageDigestTest
42 this.digest = getMessageDigest();
63 digest = null;
75 fail("failed to get digest instance: " + e);
82 assertNotNull("digest source data not found: " + digestAlgorithmName, sourceStream);
89 byte[] checkDigest = new byte[digest.getDigestLength()];
98 fail("failed to read digest golden data: " + digestAlgorithmName);
108 digest.update(buf, 0, read);
112 fail("failed to read digest data");
115 byte[] computedDigest = digest
[all...]
/libcore/benchmarks/src/benchmarks/regression/
H A DMessageDigestBenchmark.java43 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
45 digest.update(DATA, 0, DATA_SIZE);
46 digest.digest();
H A DDigestBenchmark.java60 Digest digest = digestClass.newInstance();
61 digest.update(DATA, 0, DATA_SIZE);
62 digest.doFinal(new byte[digest.getDigestSize()], 0);
/libcore/luni/src/test/java/tests/targets/security/
H A DMessageDigestTestMD2.java27 @AndroidOnly("Android doesn't include MD2 message digest algorithm")
30 MessageDigest digest = MessageDigest.getInstance("MD2");
37 MessageDigest digest = MessageDigest.getInstance(
52 MessageDigest digest = MessageDigest.getInstance("MD2");
54 digest = MessageDigest.getInstance("1.2.840.113549.2.2");
/libcore/luni/src/main/java/java/util/jar/
H A DJarVerifier.java53 * List of accepted digest algorithms. This list is in order from most
78 * Stores and a hash and a message digest and verifies that massage digest
85 private final MessageDigest digest; field in class:JarVerifier.VerifierEntry
93 VerifierEntry(String name, MessageDigest digest, byte[] hash, argument
96 this.digest = digest;
103 * Updates a digest with one byte.
107 digest.update((byte) value);
111 * Updates a digest wit
[all...]
/libcore/luni/src/test/java/libcore/java/security/
H A DMessageDigestTest.java46 assertEquals(Arrays.toString(sha_456), Arrays.toString(sha.digest()));
217 actual = md.digest();
223 actual = md.digest();
266 md.digest();
/libcore/luni/src/test/java/com/android/org/bouncycastle/jce/provider/
H A DCertBlacklistTest.java180 MessageDigest digest = MessageDigest.getInstance("SHA1");
181 byte[] hexlifiedHash = Hex.encode(digest.digest(encoded));
/libcore/luni/src/main/java/java/util/
H A DUUID.java149 return makeUuid(md.digest(name), 3);
/libcore/dex/src/main/java/com/android/dex/
H A DDex.java288 MessageDigest digest;
290 digest = MessageDigest.getInstance("SHA-1");
301 digest.update(buffer, 0, count);
303 return digest.digest();
/libcore/luni/src/main/java/java/io/
H A DObjectStreamClass.java436 MessageDigest digest;
438 digest = MessageDigest.getInstance("SHA");
602 byte[] hash = digest.digest(sha.toByteArray());
/libcore/luni/src/main/java/org/apache/harmony/security/utils/
H A DJarUtils.java173 // compute the message digest on the ASN.1 DER encoding of the Attributes value.
174 // Otherwise, compute the message digest on the data.
185 // If the authenticatedAttributes field contains the message-digest attribute,
186 // verify that it equals the computed digest of the signature file
202 // message digest entry.
218 byte[] computedDigest = md.digest(sfBytes);

Completed in 1586 milliseconds