mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
Removed unnecessary calls to MessageDigest.reset().
This commit is contained in:
@@ -33,7 +33,6 @@ class AuthorFactoryImpl implements AuthorFactory {
|
||||
w.writeString(name);
|
||||
w.writeBytes(publicKey);
|
||||
MessageDigest messageDigest = crypto.getMessageDigest();
|
||||
messageDigest.reset();
|
||||
messageDigest.update(out.toByteArray());
|
||||
AuthorId id = new AuthorId(messageDigest.digest());
|
||||
return new AuthorImpl(id, name, publicKey);
|
||||
|
||||
@@ -26,7 +26,6 @@ class AuthorReader implements ObjectReader<Author> {
|
||||
public Author readObject(Reader r) throws IOException {
|
||||
// Initialise the consumer
|
||||
DigestingConsumer digesting = new DigestingConsumer(messageDigest);
|
||||
messageDigest.reset();
|
||||
// Read and digest the data
|
||||
r.addConsumer(digesting);
|
||||
r.readStructId(Types.AUTHOR);
|
||||
|
||||
@@ -35,7 +35,6 @@ class BatchReader implements ObjectReader<UnverifiedBatch> {
|
||||
Consumer counting =
|
||||
new CountingConsumer(ProtocolConstants.MAX_PACKET_LENGTH);
|
||||
DigestingConsumer digesting = new DigestingConsumer(messageDigest);
|
||||
messageDigest.reset();
|
||||
// Read and digest the data
|
||||
r.addConsumer(counting);
|
||||
r.addConsumer(digesting);
|
||||
|
||||
@@ -33,7 +33,6 @@ class GroupFactoryImpl implements GroupFactory {
|
||||
if(publicKey == null) w.writeNull();
|
||||
else w.writeBytes(publicKey);
|
||||
MessageDigest messageDigest = crypto.getMessageDigest();
|
||||
messageDigest.reset();
|
||||
messageDigest.update(out.toByteArray());
|
||||
GroupId id = new GroupId(messageDigest.digest());
|
||||
return new GroupImpl(id, name, publicKey);
|
||||
|
||||
@@ -26,7 +26,6 @@ class GroupReader implements ObjectReader<Group> {
|
||||
public Group readObject(Reader r) throws IOException {
|
||||
// Initialise the consumer
|
||||
DigestingConsumer digesting = new DigestingConsumer(messageDigest);
|
||||
messageDigest.reset();
|
||||
// Read and digest the data
|
||||
r.addConsumer(digesting);
|
||||
r.readStructId(Types.GROUP);
|
||||
|
||||
Reference in New Issue
Block a user