aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/development/custom-vectors/idea/generate_idea.py3
-rw-r--r--docs/development/custom-vectors/idea/verify_idea.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/development/custom-vectors/idea/generate_idea.py b/docs/development/custom-vectors/idea/generate_idea.py
index c8fe7ed5..e632f473 100644
--- a/docs/development/custom-vectors/idea/generate_idea.py
+++ b/docs/development/custom-vectors/idea/generate_idea.py
@@ -17,7 +17,8 @@ def encrypt(mode, key, iv, plaintext):
def build_vectors(mode, filename):
- vector_file = open(filename, "r")
+ with open(filename, "r") as f:
+ vector_file = f.read()
count = 0
output = []
diff --git a/docs/development/custom-vectors/idea/verify_idea.py b/docs/development/custom-vectors/idea/verify_idea.py
index 692cc76e..f7e22763 100644
--- a/docs/development/custom-vectors/idea/verify_idea.py
+++ b/docs/development/custom-vectors/idea/verify_idea.py
@@ -17,7 +17,9 @@ def encrypt(mode, key, iv, plaintext):
def verify_vectors(mode, filename):
- vector_file = open(filename, "r")
+ with open(filename, "r") as f:
+ vector_file = f.read()
+
vectors = load_nist_vectors(vector_file)
for vector in vectors:
ct = encrypt(