Updated more tests

This commit is contained in:
Matthew Ellison
2024-04-08 16:44:38 -04:00
parent 1a93a30b42
commit ff11cd72c3
52 changed files with 1813 additions and 294 deletions

View File

@@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
import com.mattrixwv.cipherstream.polysubstitution.Hill;
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
import lombok.extern.slf4j.Slf4j;
@@ -21,10 +22,19 @@ import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/cipherStream/hill")
public class HillCipherController{
@GetMapping
public ObjectNode getCipherInfo(){
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
log.info("Getting info for {}", CipherInfoUtil.HILL_CIPHER_NAME);
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.HILL_CIPHER_NAME, CipherInfoUtil.HILL_CIPHER_DESCRIPTION);
}
@GetMapping("/encode")
public ObjectNode encodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Hill");
log.info("Encoding Hill");
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
log.info("Encoding {}", CipherInfoUtil.HILL_CIPHER_NAME);
CipherParameterUtil.verifyHillParams(cipherParams);
@@ -46,8 +56,8 @@ public class HillCipherController{
@GetMapping("/decode")
public ObjectNode decodeHill(@RequestBody ObjectNode cipherParams) throws JsonProcessingException{
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Hill");
log.info("Decoding Hill");
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.HILL_CIPHER_NAME);
log.info("Decoding {}", CipherInfoUtil.HILL_CIPHER_NAME);
CipherParameterUtil.verifyHillParams(cipherParams);