/usr/lib/python3/dist-packages/nacl/bindings/__pycache__
NameSizeModeActions
crypto_aead.cpython-310.pyc80160644editdlrm
crypto_box.cpython-310.pyc76000644editdlrm
crypto_core.cpython-310.pyc100010644editdlrm
crypto_generichash.cpython-310.pyc73800644editdlrm
crypto_hash.cpython-310.pyc12880644editdlrm
crypto_kx.cpython-310.pyc39830644editdlrm
crypto_pwhash.cpython-310.pyc139100644editdlrm
crypto_scalarmult.cpython-310.pyc59320644editdlrm
crypto_secretbox.cpython-310.pyc21210644editdlrm
crypto_secretstream.cpython-310.pyc83000644editdlrm
crypto_shorthash.cpython-310.pyc20670644editdlrm
crypto_sign.cpython-310.pyc84000644editdlrm
randombytes.cpython-310.pyc12240644editdlrm
sodium_core.cpython-310.pyc7740644editdlrm
utils.cpython-310.pyc37500644editdlrm
__init__.cpython-310.pyc105220644editdlrm
Edit: /usr/lib/python3/dist-packages/nacl/bindings/__pycache__/utils.cpython-310.pyc (3750B)
o a@sddlmZddlmZmZddlmZdededefddZ d ed e defd d Z d ed e defd dZ dedefddZ dededefddZdS)N)ffilib)ensureinp1inp2returncCstt|ttjdtt|ttjdtt|t|}td|}td|}t ||t|t ||t|t|t|k}t |||dk}|oO|S)zA Compare contents of two memory regions in constant time raisingzchar []r) r isinstancebytesexc TypeErrormaxlenrnewmemmover sodium_memcmp)rrlnbuf1buf2eqLeqCr5/usr/lib/python3/dist-packages/nacl/bindings/utils.pyrs  rs blocksizecCstt|ttjdtt|ttjd|dkrtjt|}||}t d|}t dd}t |||t |||||}t|dkdtj dt||dddS)z Pad the input bytearray ``s`` to a multiple of ``blocksize`` using the ISO/IEC 7816-4 algorithm :param s: input bytes string :type s: bytes :param blocksize: :type blocksize: int :return: padded string :rtype: bytes rrunsigned char [] size_t []zPadding failureN)rr r r r int ValueErrorrrrrr sodium_pad CryptoErrorbuffer)rrs_lenm_lenbufp_lenrcrrrr!)s   r!cCsntt|ttjdtt|ttjdt|}tdd}t ||||}|dkr/t d|d|dS)z Remove ISO/IEC 7816-4 padding from the input byte array ``s`` :param s: input bytes string :type s: bytes :param blocksize: :type blocksize: int :return: unpadded string :rtype: bytes rrrrzUnpadding failureN) rr r r r rrrrr sodium_unpadr")rrr$u_lenr(rrrr)Cs   r)inpcCsVtt|ttjdt|}td|}t|||t ||t ||ddS)ag Increment the value of a byte-sequence interpreted as the little-endian representation of a unsigned big integer. :param inp: input bytes buffer :type inp: bytes :return: a byte-sequence representing, as a little-endian unsigned big integer, the value ``to_int(inp)`` incremented by one. :rtype: bytes rrN) rr r r r rrrrrsodium_incrementr#)r+rr&rrrr,Xs    r,abcCstt|ttjdtt|ttjdt|}tt||ktjdtd|}td|}t|||t|||t |||t ||ddS)a Given a couple of *same-sized* byte sequences, interpreted as the little-endian representation of two unsigned integers, compute the modular addition of the represented values, in constant time for a given common length of the byte sequences. :param a: input bytes buffer :type a: bytes :param b: input bytes buffer :type b: bytes :return: a byte-sequence representing, as a little-endian big integer, the integer value of ``(to_int(a) + to_int(b)) mod 2^(8*len(a))`` :rtype: bytes rrN) rr r r r rrrrr sodium_addr#)r-r.rbuf_abuf_brrrr/qs  r/)nacl.exceptions exceptionsr nacl._sodiumrrrr boolrrr!r)r,r/rrrrs