Home
last modified time | relevance | path

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

/libcore/luni/src/main/java/java/security/
DDigestOutputStream.java33 protected MessageDigest digest; field in DigestOutputStream
47 public DigestOutputStream(OutputStream stream, MessageDigest digest) { in DigestOutputStream() argument
49 this.digest = digest; in DigestOutputStream()
58 return digest; in getMessageDigest()
67 public void setMessageDigest(MessageDigest digest) { in setMessageDigest() argument
68 this.digest = digest; in setMessageDigest()
84 digest.update((byte)b); in write()
107 digest.update(b, off, len); in write()
133 return super.toString() + ", " + digest.toString() + in toString()
DDigestInputStream.java33 protected MessageDigest digest; field in DigestInputStream
50 public DigestInputStream(InputStream stream, MessageDigest digest) { in DigestInputStream() argument
52 this.digest = digest; in DigestInputStream()
61 return digest; in getMessageDigest()
70 public void setMessageDigest(MessageDigest digest) { in setMessageDigest() argument
71 this.digest = digest; in setMessageDigest()
92 digest.update((byte)byteRead); in read()
118 digest.update(buffer, byteOffset, bytesRead); in read()
144 return super.toString() + ", " + digest.toString() + in toString()
DMessageDigest.java233 public byte[] digest() { in digest() method in MessageDigest
255 public int digest(byte[] buf, int offset, int len) throws DigestException { in digest() method in MessageDigest
276 public byte[] digest(byte[] input) { in digest() method in MessageDigest
278 return digest(); in digest()
349 return md.digest().length; in getDigestLength()
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DDigestInputStream2Test.java33 MessageDigest digest; field in DigestInputStream2Test
42 DigestInputStream dis = new DigestInputStream(inStream, digest); in test_ConstructorLjava_io_InputStreamLjava_security_MessageDigest()
52 DigestInputStream dis = new DigestInputStream(inStream, digest); in test_getMessageDigest()
53 assertEquals("getMessageDigest returned a bogus result", digest, dis in test_getMessageDigest()
62 MessageDigest originalDigest = (MessageDigest) (digest.clone()); in test_onZ()
63 MessageDigest noChangeDigest = (MessageDigest) (digest.clone()); in test_onZ()
74 MessageDigest.isEqual(noChangeDigest.digest(), originalDigest in test_onZ()
75 .digest())); in test_onZ()
76 MessageDigest changeDigest = (MessageDigest) (digest.clone()); in test_onZ()
77 dis = new DigestInputStream(inStream, digest); in test_onZ()
[all …]
DMessageDigest2Test.java92 MessageDigest.isEqual(d1.digest(), d2.digest())); in test_clone()
153 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_2()
196 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_1()
207 byte[] digest = sha.digest(); in test_digest()
208 assertTrue("bug in SHA", MessageDigest.isEqual(digest, MESSAGE_DIGEST)); in test_digest()
215 digest = sha.digest(); in test_digest()
216 assertTrue("bug in SHA", MessageDigest.isEqual(digest, MESSAGE_DIGEST_63_As)); in test_digest()
223 digest = sha.digest(); in test_digest()
224 assertTrue("bug in SHA", MessageDigest.isEqual(digest, MESSAGE_DIGEST_64_As)); in test_digest()
231 digest = sha.digest(); in test_digest()
[all …]
DMessageDigest1Test.java128 assertEquals("incorrect result", 0, md.digest().length); in test_digest()
138 assertEquals("incorrect result", 0, md.digest(b).length); in test_digestLB$()
148 assertEquals("incorrect result", 0, md.digest(b, 2, 3)); in test_digestLB$LILI()
156 md.digest(null, 0, 1); in test_digestLB$LILI()
162 md.digest(bytes, 0, bytes.length + 1); in test_digestLB$LILI()
168 md.digest(bytes, Integer.MAX_VALUE, 1); in test_digestLB$LILI()
185 assertEquals("returned status", status, md.digest(bytes, offset, len)); in test_digestLB$LILI()
188 MessageDigest digest = MessageDigest.getInstance("TestDigest", new TestProvider()); in test_digestLB$LILI() local
189 digest.digest(new byte[5], 0, 5); in test_digestLB$LILI()
268 md.digest(bytes, 0, -1); in testSHAProvider()
[all …]
DDigestOutputStreamTest.java105 MessageDigest digest = new MyMessageDigest1(); in test_getMessageDigest() local
109 DigestOutputStream dos = new DigestOutputStream(out, digest); in test_getMessageDigest()
110 assertSame(digest, dos.getMessageDigest()); in test_getMessageDigest()
122 MessageDigest digest = new MyMessageDigest1(); in test_setMessageDigestLjava_security_MessageDigest() local
128 dos.setMessageDigest(digest); in test_setMessageDigestLjava_security_MessageDigest()
129 assertSame(digest, dos.getMessageDigest()); in test_setMessageDigestLjava_security_MessageDigest()
156 assertTrue("update", Arrays.equals(dos.getMessageDigest().digest(), in testWriteint01()
193 assertTrue("update", Arrays.equals(dos.getMessageDigest().digest(), in testWriteint02()
296 assertTrue("update", Arrays.equals(dos.getMessageDigest().digest(), in test_write$BII_1()
330 assertTrue("update", Arrays.equals(dos.getMessageDigest().digest(), in test_write$BII_2()
[all …]
DDigestInputStreamTest.java126 dis.getMessageDigest().digest(), in testRead01()
161 Arrays.equals(dis.getMessageDigest().digest(), in testRead02()
196 assertTrue(Arrays.equals(dis.getMessageDigest().digest(), in testRead03()
306 assertTrue("update", Arrays.equals(dis.getMessageDigest().digest(), in testReadbyteArrayintint01()
345 assertTrue("update", Arrays.equals(dis.getMessageDigest().digest(), in testReadbyteArrayintint02()
395 assertTrue("update", Arrays.equals(dis.getMessageDigest().digest(), in testReadbyteArrayintint03()
428 Arrays.equals(dis.getMessageDigest().digest(), in testReadbyteArrayintint04()
467 assertTrue(Arrays.equals(dis.getMessageDigest().digest(), in testReadbyteArrayintint05()
543 byte[] digest = dis.getMessageDigest().digest(); in testOn()
548 Arrays.equals(digest,MDGoldenData.getDigest(algorithmName[ii])) || in testOn()
[all …]
/libcore/support/src/test/java/tests/security/
DMessageDigestTest.java33 private MessageDigest digest; field in MessageDigestTest
42 this.digest = getMessageDigest(); in setUp()
63 digest = null; in tearDown()
89 byte[] checkDigest = new byte[digest.getDigestLength()]; in getCheckDigest()
108 digest.update(buf, 0, read); in testMessageDigest1()
115 byte[] computedDigest = digest.digest(); in testMessageDigest1()
131 digest.update((byte)val); in testMessageDigest2()
138 byte[] computedDigest = digest.digest(); in testMessageDigest2()
171 digest.update(source1.getBytes(), 0, source1.length()); in testfips180_2_singleblock()
173 byte[] computedDigest = digest.digest(); in testfips180_2_singleblock()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DMessageDigestBenchmark.java43 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), in time() local
45 digest.update(DATA, 0, DATA_SIZE); in time()
46 digest.digest(); in time()
DDigestBenchmark.java60 Digest digest = digestClass.newInstance(); in time() local
61 digest.update(DATA, 0, DATA_SIZE); in time()
62 digest.doFinal(new byte[digest.getDigestSize()], 0); in time()
/libcore/luni/src/test/java/tests/targets/security/
DMessageDigestTestMD2.java30 MessageDigest digest = MessageDigest.getInstance("MD2"); in testMessageDigest1() local
37 MessageDigest digest = MessageDigest.getInstance( in testMessageDigest1() local
52 MessageDigest digest = MessageDigest.getInstance("MD2"); in testMessageDigest2() local
54 digest = MessageDigest.getInstance("1.2.840.113549.2.2"); in testMessageDigest2()
/libcore/luni/src/main/java/java/util/jar/
DJarVerifier.java85 private final MessageDigest digest; field in JarVerifier.VerifierEntry
93 VerifierEntry(String name, MessageDigest digest, byte[] hash, in VerifierEntry() argument
96 this.digest = digest; in VerifierEntry()
107 digest.update((byte) value); in write()
115 digest.update(buf, off, nbytes); in write()
130 byte[] d = digest.digest(); in verify()
389 byte[] b = md.digest(); in verify()
/libcore/luni/src/test/java/libcore/java/security/
DMessageDigestTest.java46 assertEquals(Arrays.toString(sha_456), Arrays.toString(sha.digest())); in testShaReset()
217 actual = md.digest(); in test_MessageDigest()
223 actual = md.digest(); in test_MessageDigest()
266 md.digest(); in testMessageDigest_MultipleThreads_Misuse()
/libcore/luni/src/test/java/com/android/org/bouncycastle/jce/provider/
DCertBlacklistTest.java180 MessageDigest digest = MessageDigest.getInstance("SHA1"); in getHash() local
181 byte[] hexlifiedHash = Hex.encode(digest.digest(encoded)); in getHash()
/libcore/dex/src/main/java/com/android/dex/
DDex.java288 MessageDigest digest; in computeSignature() local
290 digest = MessageDigest.getInstance("SHA-1"); in computeSignature()
301 digest.update(buffer, 0, count); in computeSignature()
303 return digest.digest(); in computeSignature()
/libcore/luni/src/main/java/java/util/
DUUID.java149 return makeUuid(md.digest(name), 3); in nameUUIDFromBytes()
/libcore/luni/src/main/java/java/io/
DObjectStreamClass.java436 MessageDigest digest; in computeSerialVersionUID() local
438 digest = MessageDigest.getInstance("SHA"); in computeSerialVersionUID()
602 byte[] hash = digest.digest(sha.toByteArray()); in computeSerialVersionUID()
/libcore/luni/src/main/java/org/apache/harmony/security/utils/
DJarUtils.java218 byte[] computedDigest = md.digest(sfBytes); in verifySignature()