|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /lib64/python2.7/site-packages/nacl/bindings/ |
Upload File : |
�
y�\c @` s� d d l m Z m Z m Z d d l m Z d d l j Z d d l m
Z
m Z d d l m Z d � Z
d � Z d � Z d � Z d
� Z d S( i ( t absolute_importt divisiont print_function( t
integer_typesN( t ffit lib( t ensurec C` s� t t | t � d t j �t t | t � d t j �t t | � t | � � } t j d | � } t j d | � } t j | | t | � � t j | | t | � � t | � t | � k } t
j | | | � d k } | o� | S( sA
Compare contents of two memory regions in constant time
t raisings char []i ( R t
isinstancet bytest exct TypeErrort maxt lenR t newt memmoveR t
sodium_memcmp( t inp1t inp2t lnt buf1t buf2t eqLt eqC( ( s5 /tmp/pip-install-A1qMVe/pynacl/nacl/bindings/utils.pyR s
c C` s� t t | t � d t j �t t | t � d t j �| d k rP t j � n t | � } | | } t j d | � } t j d d � } t j
| | | � t j | | | | | � } t | d k d d t j
�t j | | d � S( s�
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
R i s unsigned char []s size_t []i s Padding failure( R R R R
R R t
ValueErrorR
R R R R t
sodium_padt CryptoErrort buffer( t st blocksizet s_lent m_lent buft p_lent rc( ( s5 /tmp/pip-install-A1qMVe/pynacl/nacl/bindings/utils.pyR . s
c C` s� t t | t � d t j �t t | t � d t j �t | � } t j d d � } t j
| | | | � } | d k r� t j d � � n | | d S( s�
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
R s size_t []i i s Unpadding failure( R R R R
R R R
R R R t sodium_unpadR ( R R R t u_lenR"