Updating tests

This commit is contained in:
2023-05-05 20:19:27 -04:00
parent b3ca4754ea
commit 9c41f10576
45 changed files with 2729 additions and 2239 deletions

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Autokey.java
//Mattrixwv
// Created: 07-25-21
//Modified: 04-15-23
//Modified: 05-04-23
package com.mattrixwv.cipherstream.monosubstitution;
@@ -13,7 +13,8 @@ import com.mattrixwv.cipherstream.exceptions.InvalidKeywordException;
public class Autokey extends Vigenere{
protected static Logger logger = LoggerFactory.getLogger(Autokey.class);
private static final Logger logger = LoggerFactory.getLogger(Autokey.class);
//Special rules for setting the strings for encoding
protected void encodeSet(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
@@ -57,7 +58,7 @@ public class Autokey extends Vigenere{
}
//Decodes the inputString
@Override
protected String decode(){
protected void decode(){
logger.debug("Decoding");
//Decode what the key will allow, add that to the key and continue
@@ -109,7 +110,6 @@ public class Autokey extends Vigenere{
//Save and return the results
outputString = fullOutput.toString();
logger.debug("Saving output string '{}'", outputString);
return outputString;
}
@@ -125,13 +125,15 @@ public class Autokey extends Vigenere{
public String encode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
reset();
encodeSet(keyword, inputString);
return encode();
encode();
return outputString;
}
//Decodes inputString using the Autokey cipher
@Override
public String decode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
reset();
decodeSet(keyword, inputString);
return decode();
decode();
return outputString;
}
}