Skip to content

Commit

Permalink
Tweaks to disabled test0001
Browse files Browse the repository at this point in the history
Closer to being able to be re-enabled. Cryptol type checking failures on
MD5 remain.
  • Loading branch information
Aaron Tomb committed Oct 21, 2015
1 parent d7a1c80 commit ae78026
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Binary file modified intTests/test0001/JavaMD5.class
Binary file not shown.
9 changes: 4 additions & 5 deletions intTests/test0001/JavaMD5.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ public static void main(String[] args) throws Exception
{
byte[] msg = Symbolic.freshByteArray(16);

byte[] out = computeMD5( msg );
byte[] out = new byte[16];

computeMD5( msg, out );

Symbolic.writeAiger("JavaMD5.aig", out);
}

public static byte[] computeMD5( byte[] msg ) {
byte[] out = new byte[16];
public static void computeMD5( byte[] msg, byte[] out ) {
MD5Digest digest = new MD5Digest();

digest.update(msg, 0, msg.length);
digest.doFinal(out, 0);

return out;
}
}
2 changes: 1 addition & 1 deletion intTests/test0001/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
JavaMD5.class: JavaMD5.java
javac -cp ../../deps/jvm-verifier/jars/bcprov-jdk16-145.jar:../../deps/jvm-verifier/jars/galois.jar JavaMD5.java
javac -g -cp ../../deps/jvm-verifier/jars/bcprov-jdk16-145.jar:../../deps/jvm-verifier/jars/galois.jar JavaMD5.java
13 changes: 7 additions & 6 deletions intTests/test0001/javamd5test.saw
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "../support/MD5.cry";

let main = do {
c <- java_load_class "JavaMD5";
java_md5 <- java_extract c "computeMD5" java_pure;
let md5_spec = do {
msg <- java_var "msg" (java_array 16 java_byte);
java_var "out" (java_array 16 java_byte);
java_ensure_eq "out" {{ md5_ref msg }};
};

let thm1 = {{ \x -> md5_ref x == java_md5 x }};
prove_print abc thm1;
};
c <- java_load_class "JavaMD5";
java_verify c "computeMD5" [] md5_spec;

0 comments on commit ae78026

Please sign in to comment.