Home
last modified time | relevance | path

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

123

/dalvik/libcore/security/src/main/java/org/bouncycastle/jce/provider/
DJDKMessageDigest.java11 Digest digest; field in JDKMessageDigest
14 Digest digest) in JDKMessageDigest() argument
16 super(digest.getAlgorithmName()); in JDKMessageDigest()
18 this.digest = digest; in JDKMessageDigest()
23 digest.reset(); in engineReset()
29 digest.update(input); in engineUpdate()
37 digest.update(input, offset, len); in engineUpdate()
42 byte[] digestBytes = new byte[digest.getDigestSize()]; in engineDigest()
44 digest.doFinal(digestBytes, 0); in engineDigest()
65 d.digest = new SHA1Digest((SHA1Digest)digest); in clone()
[all …]
DBrokenKDF2BytesGenerator.java19 private Digest digest; field in BrokenKDF2BytesGenerator
35 Digest digest) in BrokenKDF2BytesGenerator() argument
37 this.digest = digest; in BrokenKDF2BytesGenerator()
59 return digest; in getDigest()
88 if (oBits > (digest.getDigestSize() * 8 * (2L^32 - 1))) in generateBytes()
93 int cThreshold = (int)(oBits / digest.getDigestSize()); in generateBytes()
97 dig = new byte[digest.getDigestSize()]; in generateBytes()
101 digest.update(shared, 0, shared.length); in generateBytes()
103 digest.update((byte)(counter & 0xff)); in generateBytes()
104 digest.update((byte)((counter >> 8) & 0xff)); in generateBytes()
[all …]
DJCESecretKeyFactory.java111 private int digest; field in JCESecretKeyFactory.PBEKeyFactory
120 int digest, in PBEKeyFactory() argument
128 this.digest = digest; in PBEKeyFactory()
144 … return new JCEPBEKey(this.algName, this.algOid, scheme, digest, keySize, ivSize, pbeSpec, null); in engineGenerateSecret()
149 param = Util.makePBEParameters(pbeSpec, scheme, digest, keySize, ivSize); in engineGenerateSecret()
153 param = Util.makePBEMacParameters(pbeSpec, scheme, digest, keySize); in engineGenerateSecret()
156 … return new JCEPBEKey(this.algName, this.algOid, scheme, digest, keySize, ivSize, pbeSpec, param); in engineGenerateSecret()
168 private int digest; field in JCESecretKeyFactory.DESPBEKeyFactory
177 int digest, in DESPBEKeyFactory() argument
185 this.digest = digest; in DESPBEKeyFactory()
[all …]
DJDKDSASigner.java44 private Digest digest; field in JDKDSASigner
50 Digest digest, in JDKDSASigner() argument
55 this.digest = digest; in JDKDSASigner()
114 digest.reset(); in engineInitVerify()
150 digest.reset(); in engineInitSign()
166 digest.update(b); in engineUpdate()
175 digest.update(b, off, len); in engineUpdate()
181 byte[] hash = new byte[digest.getDigestSize()]; in engineSign()
183 digest.doFinal(hash, 0); in engineSign()
201 byte[] hash = new byte[digest.getDigestSize()]; in engineVerify()
[all …]
DJDKDigestSignature.java45 private Digest digest; field in JDKDigestSignature
52 Digest digest, in JDKDigestSignature() argument
57 this.digest = digest; in JDKDigestSignature()
73 digest.reset(); in engineInitVerify()
88 digest.reset(); in engineInitSign()
108 digest.update(b); in engineUpdate()
117 digest.update(b, off, len); in engineUpdate()
123 byte[] hash = new byte[digest.getDigestSize()]; in engineSign()
125 digest.doFinal(hash, 0); in engineSign()
147 byte[] hash = new byte[digest.getDigestSize()]; in engineVerify()
[all …]
DJCEPBEKey.java18 int digest; field in JCEPBEKey
32 int digest, in JCEPBEKey() argument
41 this.digest = digest; in JCEPBEKey()
95 return digest; in getDigest()
/dalvik/libcore/security/src/main/java/org/bouncycastle/crypto/macs/
DHMac.java22 private Digest digest; field in HMac
55 Digest digest) in getByteLength() argument
57 if (digest instanceof ExtendedDigest) in getByteLength()
59 return ((ExtendedDigest)digest).getByteLength(); in getByteLength()
62 Integer b = (Integer)blockLengths.get(digest.getAlgorithmName()); in getByteLength()
66 … throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName()); in getByteLength()
79 Digest digest) in HMac() argument
81 this(digest, getByteLength(digest)); in HMac()
85 Digest digest, in HMac() argument
88 this.digest = digest; in HMac()
[all …]
DOldHMac.java21 private Digest digest; field in OldHMac
30 Digest digest) in OldHMac() argument
32 this.digest = digest; in OldHMac()
33 digestSize = digest.getDigestSize(); in OldHMac()
38 return digest.getAlgorithmName() + "/HMAC"; in getAlgorithmName()
43 return digest; in getUnderlyingDigest()
49 digest.reset(); in init()
55 digest.update(key, 0, key.length); in init()
56 digest.doFinal(inputPad, 0); in init()
84 digest.update(inputPad, 0, inputPad.length); in init()
[all …]
/dalvik/libcore/security/src/main/java/java/security/
DDigestOutputStream.java40 protected MessageDigest digest; field in DigestOutputStream
55 public DigestOutputStream(OutputStream stream, MessageDigest digest) { in DigestOutputStream() argument
57 this.digest = digest; in DigestOutputStream()
67 return digest; in getMessageDigest()
77 public void setMessageDigest(MessageDigest digest) { in setMessageDigest() argument
78 this.digest = digest; in setMessageDigest()
94 digest.update((byte)b); in write()
117 digest.update(b, off, len); in write()
143 return super.toString() + ", " + digest.toString() + //$NON-NLS-1$ in toString()
DDigestInputStream.java42 protected MessageDigest digest; field in DigestInputStream
57 public DigestInputStream(InputStream stream, MessageDigest digest) { in DigestInputStream() argument
59 this.digest = digest; in DigestInputStream()
69 return digest; in getMessageDigest()
79 public void setMessageDigest(MessageDigest digest) { in setMessageDigest() argument
80 this.digest = digest; in setMessageDigest()
102 digest.update((byte)byteRead); in read()
136 digest.update(b, off, bytesRead); in read()
162 return super.toString() + ", " + digest.toString() + //$NON-NLS-1$ in toString()
/dalvik/libcore/security/src/main/java/org/bouncycastle/crypto/generators/
DPKCS5S1ParametersGenerator.java21 private Digest digest; field in PKCS5S1ParametersGenerator
29 Digest digest) in PKCS5S1ParametersGenerator() argument
31 this.digest = digest; in PKCS5S1ParametersGenerator()
39 byte[] digestBytes = new byte[digest.getDigestSize()]; in generateDerivedKey()
41 digest.update(password, 0, password.length); in generateDerivedKey()
42 digest.update(salt, 0, salt.length); in generateDerivedKey()
44 digest.doFinal(digestBytes, 0); in generateDerivedKey()
47 digest.update(digestBytes, 0, digestBytes.length); in generateDerivedKey()
48 digest.doFinal(digestBytes, 0); in generateDerivedKey()
67 if (keySize > digest.getDigestSize()) in generateDerivedParameters()
[all …]
DBaseKDFBytesGenerator.java19 private Digest digest; field in BaseKDFBytesGenerator
31 Digest digest) in BaseKDFBytesGenerator() argument
34 this.digest = digest; in BaseKDFBytesGenerator()
65 return digest; in getDigest()
87 int outLen = digest.getDigestSize(); in generateBytes()
104 dig = new byte[digest.getDigestSize()]; in generateBytes()
110 digest.update(shared, 0, shared.length); in generateBytes()
112 digest.update((byte)(counter >> 24)); in generateBytes()
113 digest.update((byte)(counter >> 16)); in generateBytes()
114 digest.update((byte)(counter >> 8)); in generateBytes()
[all …]
DMGF1BytesGenerator.java15 private Digest digest; field in MGF1BytesGenerator
23 Digest digest) in MGF1BytesGenerator() argument
25 this.digest = digest; in MGF1BytesGenerator()
26 this.hLen = digest.getDigestSize(); in MGF1BytesGenerator()
47 return digest; in getDigest()
84 digest.reset(); in generateBytes()
92 digest.update(seed, 0, seed.length); in generateBytes()
93 digest.update(C, 0, C.length); in generateBytes()
94 digest.doFinal(hashBuf, 0); in generateBytes()
105 digest.update(seed, 0, seed.length); in generateBytes()
[all …]
DPKCS12ParametersGenerator.java24 private Digest digest; field in PKCS12ParametersGenerator
37 Digest digest) in PKCS12ParametersGenerator() argument
39 this.digest = digest; in PKCS12ParametersGenerator()
40 if (digest instanceof ExtendedDigest) in PKCS12ParametersGenerator()
42 u = digest.getDigestSize(); in PKCS12ParametersGenerator()
43 v = ((ExtendedDigest)digest).getByteLength(); in PKCS12ParametersGenerator()
47 … throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported"); in PKCS12ParametersGenerator()
133 digest.update(D, 0, D.length); in generateDerivedKey()
134 digest.update(I, 0, I.length); in generateDerivedKey()
135 digest.doFinal(A, 0); in generateDerivedKey()
[all …]
DOpenSSLPBEParametersGenerator.java20 private Digest digest = new MD5Digest(); field in OpenSSLPBEParametersGenerator
48 byte[] buf = new byte[digest.getDigestSize()]; in generateDerivedKey()
54 digest.update(password, 0, password.length); in generateDerivedKey()
55 digest.update(salt, 0, salt.length); in generateDerivedKey()
57 digest.doFinal(buf, 0); in generateDerivedKey()
71 digest.reset(); in generateDerivedKey()
72 digest.update(buf, 0, buf.length); in generateDerivedKey()
/dalvik/libcore/security/src/main/java/org/bouncycastle/crypto/signers/
DISO9796d2PSSSigner.java33 private Digest digest; field in ISO9796d2PSSSigner
60 Digest digest, in ISO9796d2PSSSigner() argument
65 this.digest = digest; in ISO9796d2PSSSigner()
66 this.hLen = digest.getDigestSize(); in ISO9796d2PSSSigner()
75 if (digest instanceof SHA1Digest) in ISO9796d2PSSSigner()
105 Digest digest, in ISO9796d2PSSSigner() argument
108 this(cipher, digest, saltLength, false); in ISO9796d2PSSSigner()
161 mBuf = new byte[block.length - digest.getDigestSize() - lengthOfSalt - 1 - 1]; in init()
165 mBuf = new byte[block.length - digest.getDigestSize() - lengthOfSalt - 1 - 2]; in init()
218 digest.update(b); in update()
[all …]
DPSSSigner.java25 private Digest digest; field in PSSSigner
46 Digest digest, in PSSSigner() argument
49 this(cipher, digest, sLen, TRAILER_IMPLICIT); in PSSSigner()
54 Digest digest, in PSSSigner() argument
59 this.digest = digest; in PSSSigner()
60 this.hLen = digest.getDigestSize(); in PSSSigner()
116 digest.update(b); in update()
127 digest.update(in, off, len); in update()
135 digest.reset(); in reset()
150 digest.doFinal(mDash, mDash.length - hLen - sLen); in generateSignature()
[all …]
DISO9796d2Signer.java26 private Digest digest; field in ISO9796d2Signer
47 Digest digest, in ISO9796d2Signer() argument
51 this.digest = digest; in ISO9796d2Signer()
59 if (digest instanceof SHA1Digest) in ISO9796d2Signer()
88 Digest digest) in ISO9796d2Signer() argument
90 this(cipher, digest, false); in ISO9796d2Signer()
107 mBuf = new byte[block.length - digest.getDigestSize() - 2]; in init()
111 mBuf = new byte[block.length - digest.getDigestSize() - 3]; in init()
176 digest.update(b); in update()
194 digest.update(in, off, len); in update()
[all …]
/dalvik/libcore/security/src/main/java/org/bouncycastle/crypto/io/
DDigestOutputStream.java12 protected Digest digest; field in DigestOutputStream
16 Digest digest) in DigestOutputStream() argument
19 this.digest = digest; in DigestOutputStream()
25 digest.update((byte)b); in write()
35 digest.update(b, off, len); in write()
41 return digest; in getDigest()
DDigestInputStream.java12 protected Digest digest; field in DigestInputStream
16 Digest digest) in DigestInputStream() argument
19 this.digest = digest; in DigestInputStream()
29 digest.update((byte)b); in read()
43 digest.update(b, off, n); in read()
50 return digest; in getDigest()
/dalvik/libcore/security/src/test/java/org/apache/harmony/security/tests/java/security/
DDigestInputStream2Test.java38 MessageDigest digest; field in DigestInputStream2Test
53 DigestInputStream dis = new DigestInputStream(inStream, digest); in test_ConstructorLjava_io_InputStreamLjava_security_MessageDigest()
69 DigestInputStream dis = new DigestInputStream(inStream, digest); in test_getMessageDigest()
70 assertEquals("getMessageDigest returned a bogus result", digest, dis in test_getMessageDigest()
85 MessageDigest originalDigest = (MessageDigest) (digest.clone()); in test_onZ()
86 MessageDigest noChangeDigest = (MessageDigest) (digest.clone()); in test_onZ()
97 MessageDigest.isEqual(noChangeDigest.digest(), originalDigest in test_onZ()
98 .digest())); in test_onZ()
99 MessageDigest changeDigest = (MessageDigest) (digest.clone()); in test_onZ()
100 dis = new DigestInputStream(inStream, digest); in test_onZ()
[all …]
DMessageDigest2Test.java109 + digestAlgs[i], MessageDigest.isEqual(d1.digest(), d2 in test_clone()
110 .digest())); in test_clone()
182 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_2()
232 byte[] hash = sha.digest(data); in testSerializationSHA_DATA_1()
257 byte[] digest = sha.digest(); in test_digest()
258 assertTrue("bug in SHA", MessageDigest.isEqual(digest, MESSAGE_DIGEST)); in test_digest()
265 digest = sha.digest(); in test_digest()
266 assertTrue("bug in SHA", MessageDigest.isEqual(digest, in test_digest()
274 digest = sha.digest(); in test_digest()
275 assertTrue("bug in SHA", MessageDigest.isEqual(digest, in test_digest()
[all …]
/dalvik/libcore/security/src/test/java/tests/targets/security/
DMessageDigestTest.java37 private MessageDigest digest; field in MessageDigestTest
46 this.digest = getMessageDigest(); in setUp()
67 digest = null; in tearDown()
97 byte[] checkDigest = new byte[digest.getDigestLength()]; in getCheckDigest()
135 digest.update(buf, 0, read); in testMessageDigest1()
141 byte[] computedDigest = digest.digest(); in testMessageDigest1()
178 digest.update((byte)val); in testMessageDigest2()
184 byte[] computedDigest = digest.digest(); in testMessageDigest2()
232 digest.update(source1.getBytes(), 0, source1.length()); in testfips180_2_singleblock()
234 byte[] computedDigest = digest.digest(); in testfips180_2_singleblock()
[all …]
/dalvik/libcore/security/src/main/java/org/bouncycastle/asn1/x509/
DDigestInfo.java25 private byte[] digest; field in DigestInfo
52 byte[] digest) in DigestInfo() argument
54 this.digest = digest; in DigestInfo()
64 digest = ASN1OctetString.getInstance(e.nextElement()).getOctets(); in DigestInfo()
74 return digest; in getDigest()
82 v.add(new DEROctetString(digest)); in toASN1Object()
DAuthorityKeyIdentifier.java95 Digest digest = new SHA1Digest(); in AuthorityKeyIdentifier() local
96 byte[] resBuf = new byte[digest.getDigestSize()]; in AuthorityKeyIdentifier()
99 digest.update(bytes, 0, bytes.length); in AuthorityKeyIdentifier()
100 digest.doFinal(resBuf, 0); in AuthorityKeyIdentifier()
113 Digest digest = new SHA1Digest(); in AuthorityKeyIdentifier() local
114 byte[] resBuf = new byte[digest.getDigestSize()]; in AuthorityKeyIdentifier()
117 digest.update(bytes, 0, bytes.length); in AuthorityKeyIdentifier()
118 digest.doFinal(resBuf, 0); in AuthorityKeyIdentifier()

123