aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2022-11-17 18:08:59 -0800
committerDeterminant <[email protected]>2022-11-17 18:08:59 -0800
commit8154806fe2fccacdc3dafaa68181a07bcf8d6c4c (patch)
treef477e6a005599bb88c18db142c267b9297c6060b /frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py
parentbe4dc086591c9bced04a507d127c83811c5700c4 (diff)
v0.1.7
Diffstat (limited to 'frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py')
-rw-r--r--frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py b/frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py
index 3207bbe..7525c5d 100644
--- a/frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py
+++ b/frozen_deps/Cryptodome/Cipher/PKCS1_OAEP.py
@@ -188,9 +188,9 @@ class PKCS1OAEP_Cipher:
# Step 3f
db = strxor(maskedDB, dbMask)
# Step 3g
- one_pos = db[hLen:].find(b'\x01')
+ one_pos = hLen + db[hLen:].find(b'\x01')
lHash1 = db[:hLen]
- invalid = bord(y) | int(one_pos < 0)
+ invalid = bord(y) | int(one_pos < hLen)
hash_compare = strxor(lHash1, lHash)
for x in hash_compare:
invalid |= bord(x)
@@ -199,7 +199,7 @@ class PKCS1OAEP_Cipher:
if invalid != 0:
raise ValueError("Incorrect decryption.")
# Step 4
- return db[hLen + one_pos + 1:]
+ return db[one_pos + 1:]
def new(key, hashAlgo=None, mgfunc=None, label=b'', randfunc=None):
"""Return a cipher object :class:`PKCS1OAEP_Cipher` that can be used to perform PKCS#1 OAEP encryption or decryption.