aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/Math/_IntegerCustom.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/Math/_IntegerCustom.py
parentbe4dc086591c9bced04a507d127c83811c5700c4 (diff)
v0.1.7
Diffstat (limited to 'frozen_deps/Cryptodome/Math/_IntegerCustom.py')
-rw-r--r--frozen_deps/Cryptodome/Math/_IntegerCustom.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/frozen_deps/Cryptodome/Math/_IntegerCustom.py b/frozen_deps/Cryptodome/Math/_IntegerCustom.py
index b626014..0e23152 100644
--- a/frozen_deps/Cryptodome/Math/_IntegerCustom.py
+++ b/frozen_deps/Cryptodome/Math/_IntegerCustom.py
@@ -57,7 +57,14 @@ implementation = {"library": "custom", "api": backend}
class IntegerCustom(IntegerNative):
@staticmethod
- def from_bytes(byte_string):
+ def from_bytes(byte_string, byteorder='big'):
+ if byteorder == 'big':
+ pass
+ elif byteorder == 'little':
+ byte_string = bytearray(byte_string)
+ byte_string.reverse()
+ else:
+ raise ValueError("Incorrect byteorder")
return IntegerCustom(bytes_to_long(byte_string))
def inplace_pow(self, exponent, modulus=None):