diff options
Diffstat (limited to 'libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/cavp/KDFFeedbackNoCounterTests.java')
-rw-r--r-- | libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/cavp/KDFFeedbackNoCounterTests.java | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/cavp/KDFFeedbackNoCounterTests.java b/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/cavp/KDFFeedbackNoCounterTests.java deleted file mode 100644 index 4c6fa942b..000000000 --- a/libraries/spongycastle/core/src/test/java/org/spongycastle/crypto/test/cavp/KDFFeedbackNoCounterTests.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.spongycastle.crypto.test.cavp; - -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Properties; - -import org.spongycastle.crypto.Mac; -import org.spongycastle.crypto.generators.KDFFeedbackBytesGenerator; -import org.spongycastle.crypto.params.KDFFeedbackParameters; -import org.spongycastle.util.Arrays; -import org.spongycastle.util.encoders.Hex; -import org.spongycastle.util.test.SimpleTestResult; -import org.spongycastle.util.test.TestFailedException; - -public final class KDFFeedbackNoCounterTests - implements CAVPListener -{ - private PrintWriter out; - - public void receiveCAVPVectors(String name, Properties config, - Properties vectors) - { - - - // create Mac based PRF from PRF property, create the KDF - final Mac prf = CAVPReader.createPRF(config); - final KDFFeedbackBytesGenerator gen = new KDFFeedbackBytesGenerator(prf); - - final int count = Integer.parseInt(vectors.getProperty("COUNT")); - final int l = Integer.parseInt(vectors.getProperty("L")); - final byte[] ki = Hex.decode(vectors.getProperty("KI")); - final byte[] iv = Hex.decode(vectors.getProperty("IV")); - final byte[] fixedInputData = Hex.decode(vectors.getProperty("FixedInputData")); - final KDFFeedbackParameters params = KDFFeedbackParameters.createWithoutCounter(ki, iv, fixedInputData); - gen.init(params); - - final byte[] koGenerated = new byte[l / 8]; - gen.generateBytes(koGenerated, 0, koGenerated.length); - - final byte[] koVectors = Hex.decode(vectors.getProperty("KO")); - - compareKO(name, config, count, koGenerated, koVectors); - } - - private static void compareKO( - String name, Properties config, int test, byte[] calculatedOKM, byte[] testOKM) - { - - if (!Arrays.areEqual(calculatedOKM, testOKM)) - { - throw new TestFailedException(new SimpleTestResult( - false, name + " using " + config + " test " + test + " failed")); - - } - } - - public void receiveCommentLine(String commentLine) - { -// out.println("# " + commentLine); - } - - public void receiveStart(String name) - { - // do nothing - } - - public void receiveEnd() - { - out.println(" *** *** *** "); - } - - public void setup() - { - try - { - out = new PrintWriter(new FileWriter("KDFFeedbackNoCounter.gen")); - } - catch (IOException e) - { - throw new IllegalStateException(e); - } - } - - public void tearDown() - { - out.close(); - } -}
\ No newline at end of file |