Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
sawano committed Mar 25, 2017
1 parent ebbd146 commit 44959c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/se/sawano/java/security/otp/SharedSecret.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
import static org.apache.commons.lang3.Validate.notNull;

/**
* RFC4226 requires a shared secret with minimum length of 128 bits. And recommends the secret to be at leas 160 bits (20 bytes). This class requires the secret to be at least 20 bytes.
* RFC4226 requires a shared secret with minimum length of 128 bits. And recommends the secret to be at leas 160 bits (20 bytes). This class takes an opinionated view and requires the secret to be at
* least 20 bytes.
*/
public final class SharedSecret implements Externalizable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public DefaultSecretService(final RandomSupplier random) {
notNull(random);

this.random = random;
// TODO consolidate with SharedSecret?
// TODO review these lengths
algorithmToNumberOfBytes.put(ShaAlgorithm.SHA1, 20);
algorithmToNumberOfBytes.put(ShaAlgorithm.SHA256, 32);
algorithmToNumberOfBytes.put(ShaAlgorithm.SHA512, 64);
Expand Down

0 comments on commit 44959c7

Please sign in to comment.