Skip to content

Commit

Permalink
Fixing usage of DataOutputStream
Browse files Browse the repository at this point in the history
  • Loading branch information
emopers authored and Wajihulhassan committed Jan 11, 2016
1 parent 8126929 commit 4fd7cb8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Expand Up @@ -252,6 +252,7 @@ public void writeTo(OutputStream os) throws IOException {
dos.writeBoolean(fastFp);
dos.write(polyType.ordinal());
dos.writeUTF(hashAlg);
dos.flush();
}


Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignatureParameters.java
Expand Up @@ -213,6 +213,7 @@ public void writeTo(OutputStream os) throws IOException {
dos.write(keyGenAlg.ordinal());
dos.writeUTF(hashAlg);
dos.write(polyType.ordinal());
dos.flush();
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignaturePrivateKey.java
Expand Up @@ -147,6 +147,7 @@ public byte[] getEncoded() {
for (int i=0; i<numBases; i++)
// all bases except for the first one contain a public key
bases.get(i).encode(os, i!=0);
dataStream.close();
} catch (IOException e) {
throw new NtruException(e);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignaturePublicKey.java
Expand Up @@ -92,6 +92,7 @@ public byte[] getEncoded() {
dataStream.writeShort(h.coeffs.length);
dataStream.writeShort(q);
dataStream.write(h.toBinary(q));
dataStream.close();
} catch (IOException e) {
throw new NtruException(e);
}
Expand Down

0 comments on commit 4fd7cb8

Please sign in to comment.