diff --git a/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BlockCipher.codyze.kts b/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BlockCipher.codyze.kts new file mode 100644 index 000000000..761cb1687 --- /dev/null +++ b/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BlockCipher.codyze.kts @@ -0,0 +1,16 @@ +interface BlockCiper { + fun algorithm(algo: Any): Op + fun blockLength(length: Any): Op + fun mode(mode: Any): Op + fun padding(pad: Any): Op +} + + +// TODO: need evaluator with condition so we can check if algorithm is AES +@Rule(description = "Check the block length of AES") +fun `correct AES block length`(blockCiper: BlockCiper) = + only(blockCiper.blockLength(listOf(128, 192, 256))) + +@Rule(description = "Check the operation mode of ") +fun `correct mode`(blockCiper: BlockCiper) = + only(blockCiper.mode(listOf("CCM", "GCM", "CBC", "CTR"))) \ No newline at end of file diff --git a/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BouncyCastleCipher.codyze.kts b/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BouncyCastleCipher.codyze.kts new file mode 100644 index 000000000..357edc296 --- /dev/null +++ b/codyze-specification-languages/coko/coko-dsl/src/test/resources/security-example/BouncyCastleCipher.codyze.kts @@ -0,0 +1,24 @@ +@file:Import("BlockCipher.codyze.kts") + +class Cipher { + +} + +class BouncyCastleBlockCipher: BlockCipher_codyze.BlockCiper { + override fun algorithm(algo: Any): Op { + TODO("Not yet implemented") + } + + override fun blockLength(length: Any): Op { + TODO("Not yet implemented") + } + + override fun mode(mode: Any): Op { + TODO("Not yet implemented") + } + + override fun padding(pad: Any): Op { + TODO("Not yet implemented") + } + +} \ No newline at end of file