directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [1/2] directory-kerby git commit: Remove an inappropriate javadoc.
Date Tue, 28 Apr 2015 13:12:21 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master c74a12d6d -> b916277b9


Remove an inappropriate javadoc.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/6ff29517
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/6ff29517
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/6ff29517

Branch: refs/heads/master
Commit: 6ff2951724f953d9c183608b450a25662af8f597
Parents: c2d9303
Author: Lin <linchen7@foxmail.com>
Authored: Tue Apr 28 21:11:46 2015 -0700
Committer: Lin <linchen7@foxmail.com>
Committed: Tue Apr 28 21:11:46 2015 -0700

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/crypto/PrfTest.java     | 53 +++++++++-----------
 1 file changed, 25 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6ff29517/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
index 6a53576..1e17df7 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
@@ -27,23 +27,21 @@ import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.fail;
 
-/**
- * Created by yaningxu on 4/13/2015.
- */
 public class PrfTest {
-    static class TestCase {
-        EncryptionType encType;
-        String keyData;
-        String seed;
-        String answer;
-        TestCase(EncryptionType encType, String keyData,
-                 String seed, String answer) {
-            this.encType = encType;
-            this.keyData = keyData;
-            this.seed = seed;
-            this.answer = answer;
-        }
+    private static void performTest(TestCase testCase) throws Exception {
+        byte[] keyData = EncryptionHandler.getEncHandler(testCase.encType).str2key(testCase.keyData,
testCase.keyData, null);
+        byte[] seed = HexUtil.hex2bytes(testCase.seed);
+        byte[] answer = HexUtil.hex2bytes(testCase.answer);
+        byte[] outkey = EncryptionHandler.getEncHandler(testCase.encType).prf(keyData, seed);
 
+        if (! Arrays.equals(answer, outkey)) {
+            System.err.println("failed with:");
+            System.err.println("outKey:" + HexUtil.bytesToHex(outkey));
+            System.err.println("answer:" + testCase.answer);
+            fail("KeyDerive test failed for " + testCase.encType.getName());
+        } else {
+            System.out.println("Prf test OK for " + testCase.encType.getName());
+        }
     }
 
     @Test
@@ -146,19 +144,18 @@ public class PrfTest {
         ));
     }
 
-    private static void performTest(TestCase testCase) throws Exception {
-        byte[] keyData = EncryptionHandler.getEncHandler(testCase.encType).str2key(testCase.keyData,
testCase.keyData, null);
-        byte[] seed = HexUtil.hex2bytes(testCase.seed);
-        byte[] answer = HexUtil.hex2bytes(testCase.answer);
-        byte[] outkey = EncryptionHandler.getEncHandler(testCase.encType).prf(keyData, seed);
-
-        if (! Arrays.equals(answer, outkey)) {
-            System.err.println("failed with:");
-            System.err.println("outKey:" + HexUtil.bytesToHex(outkey));
-            System.err.println("answer:" + testCase.answer);
-            fail("KeyDerive test failed for " + testCase.encType.getName());
-        } else {
-            System.out.println("Prf test OK for " + testCase.encType.getName());
+    static class TestCase {
+        EncryptionType encType;
+        String keyData;
+        String seed;
+        String answer;
+        TestCase(EncryptionType encType, String keyData,
+                 String seed, String answer) {
+            this.encType = encType;
+            this.keyData = keyData;
+            this.seed = seed;
+            this.answer = answer;
         }
+
     }
 }


Mime
View raw message