aboutsummaryrefslogtreecommitdiffstats
path: root/wrappers/swig/tests/block2.py
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/swig/tests/block2.py')
-rw-r--r--wrappers/swig/tests/block2.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/wrappers/swig/tests/block2.py b/wrappers/swig/tests/block2.py
deleted file mode 100644
index 5faccaf9a..000000000
--- a/wrappers/swig/tests/block2.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/python
-
-import botan, base64
-
-class MyCipher(botan.BlockCipherImpl):
- def __init__(self):
- botan.BlockCipherImpl.__init__(self, 8, 8, 16, 1)
-
- def name(self):
- return "MyCipher"
-
- def encrypt(self, input):
- return input.swapcase()
-
- def decrypt(self, input):
- return input.swapcase()
-
- def set_key(self, key):
- print "Got key",key
-
-def test(cipher):
- print
- print cipher
- print "Testing", cipher.name()
- print cipher.block_size
- print cipher.keylength_min, cipher.keylength_max, cipher.keylength_mod
- for i in range(1, 64):
- if cipher.valid_keylength(i):
- print "1",
- else:
- print "0",
- print
- cipher.set_key(botan.SymmetricKey(16))
- ciphertext = cipher.encrypt("aBcDeFgH" * (cipher.block_size / 8))
- print repr(ciphertext)
- print cipher.decrypt(ciphertext)
-
-def main():
- test(botan.BlockCipher("Blowfish"))
- test(MyCipher())
- test(botan.BlockCipher("AES"))
-
-if __name__ == "__main__":
- main()