Skip to content

Commit

Permalink
Add better tests for HFunctionFactoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickfav committed Nov 19, 2018
1 parent 04fca5a commit eac6a3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.60</version>
<scope>test</scope>
</dependency>
</dependencies>

<developers>
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/at/favre/lib/crypto/HFunctionFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import at.favre.lib.bytes.Bytes;
import org.junit.Test;

import java.security.Security;

import static org.junit.Assert.*;

public class HFunctionFactoryTest {
Expand All @@ -20,9 +22,11 @@ public void testIllegalHashFunctionHmac() {
@Test
public void testSimpleChecks() {
simpleCheck(new HFunctionFactory.Default.DigestFactory("SHA-256"));
simpleCheck(new HFunctionFactory.Default.DigestFactory("SHA-256", Security.getProvider("BC")));
simpleCheck(new HFunctionFactory.Default.DigestFactory("SHA-384"));
simpleCheck(new HFunctionFactory.Default.DigestFactory("SHA-512"));
simpleCheck(new HFunctionFactory.Default.MacFactory("HmacSha256"));
simpleCheck(new HFunctionFactory.Default.MacFactory("HmacSha256", Security.getProvider("BC")));
simpleCheck(new HFunctionFactory.Default.MacFactory("HmacSha512"));
simpleCheck(HFunctionFactory.Default.sha256());
simpleCheck(HFunctionFactory.Default.sha512());
Expand Down

0 comments on commit eac6a3d

Please sign in to comment.