summaryrefslogtreecommitdiff
path: root/aesgcmanalysis.py
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2022-08-27 05:46:17 -0400
committercyfraeviolae <cyfraeviolae>2022-08-27 05:46:17 -0400
commit36b27e733c83e02ac54d7a6c1aa0a43938d1fc1f (patch)
tree23f97f54ec8390c782a4a6aa34135e95894570b0 /aesgcmanalysis.py
parent00e2704d0039ed9dbbfec54b2643da395f642f66 (diff)
key com
Diffstat (limited to 'aesgcmanalysis.py')
-rw-r--r--aesgcmanalysis.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/aesgcmanalysis.py b/aesgcmanalysis.py
index b833376..13bfca3 100644
--- a/aesgcmanalysis.py
+++ b/aesgcmanalysis.py
@@ -761,8 +761,6 @@ def collide(k1, k2, nonce, c):
acc = gf128_mul(lens, gf128_add(h1, h2))
acc = gf128_add(acc, gf128_add(p1, p2))
for i in range(1, mlen):
- if i % 2048 == 0:
- print(i, end=', ')
hi = gf128_add(gf128_exp(h1, mlen+2-i), gf128_exp(h2, mlen+2-i))
acc = gf128_add(acc, gf128_mul(bytes_to_gf128(c[(i-1)*16:((i-1)+1)*16]), hi))
inv = gf128_inv(gf128_add(gf128_mul(h1, h1), gf128_mul(h2, h2)))
@@ -837,7 +835,6 @@ def att_merge_jpg_bmp(jpg, bmp, aad):
total_len = 6 + (0xff<<8) + 0xff + len(jpg)
jpgstream, _ = gcm_encrypt(k1, nonce, aad, b'\x00'*total_len)
bmpstream, _ = gcm_encrypt(k2, nonce, aad, b'\x00'*total_len)
- print("enc")
# 5 bytes
r = xor(jpgstream, b'\xff\xd8\xff\xfe\xff')
@@ -866,7 +863,6 @@ def att_merge_jpg_bmp(jpg, bmp, aad):
tailx = xor(tail, jpgstream[6+comlen+len(jpg)-4:])
r += tailx
assert len(r) % 16 == 0
- print("collide")
cfin, macfin = collide_penultimate(k1, k2, nonce, r)