thirdparty/blake/blake.py
def addsalt(self, salt):
        """ adds a salt to the hash function (OPTIONAL)
            should be called AFTER Init, and BEFORE update
            salt:  a bytestring, length determined by hashbitlen.
                   if not of sufficient length, the bytestring
                   will be assumed to be a big endian number and
                   prefixed with an appropriate number of null
                   bytes, and if too large, only the low order
                   bytes will be used.

              if hashbitlen=224 or 256, then salt will be 16 bytes
              if hashbitlen=384 or 512, then salt will be 32 bytes
        """
        # fail if addsalt() was not called at the right time
        if self.state != 1:
            raise Exception('addsalt() not called after init() and before update()')
        # salt size is to be 4x word size
        saltsize = self.WORDBYTES * 4
        # if too short, prefix with null bytes.  if too long,
        # truncate high order bytes
        if len(salt) < saltsize:
            salt = (chr(0) * (saltsize - len(salt)) + salt)
        else:
            salt = salt[-saltsize:]
        # prep the salt array
        self.salt[0] = self.byte2int(salt[: 4 << self.mul])
        self.salt[1] = self.byte2int(salt[4 << self.mul: 8 << self.mul])
        self.salt[2] = self.byte2int(salt[8 << self.mul:12 << self.mul])
        self.salt[3] = self.byte2int(salt[12 << self.mul:])
 adds a salt to the hash function (OPTIONAL)
            should be called AFTER Init, and BEFORE update
            salt:  a bytestring, length determined by hashbitlen.
                   if not of sufficient length, the bytestring
                   will be assumed to be a big endian number and
                   prefixed with an appropriate number of null
                   bytes, and if too large, only the low order
                   bytes will be used.

              if hashbitlen=224 or 256, then salt will be 16 bytes
              if hashbitlen=384 or 512, then salt will be 32 bytes
        
adds a salt to the hash function (OPTIONAL)
should be called AFTER Init, and BEFORE update
salt:  a bytestring, length determined by hashbitlen.
if not of sufficient length, the bytestring
will be assumed to be a big endian number and
prefixed with an appropriate number of null
bytes, and if too large, only the low order
bytes will be used.

if hashbitlen=224 or 256, then salt will be 16 bytes
if hashbitlen=384 or 512, then salt will be 32 bytes
adds a salt to the hash function ( OPTIONAL ) should be called AFTER Init and BEFORE update salt : a bytestring length determined by hashbitlen . if not of sufficient length the bytestring will be assumed to be a big endian number and prefixed with an appropriate number of null bytes and if too large only the low order bytes will be used . if hashbitlen = 224 or 256 then salt will be 16 bytes if hashbitlen = 384 or 512 then salt will be 32 bytes
def addsalt(self, salt):
        if self.state != 1:
            raise Exception('addsalt() not called after init() and before update()')
        saltsize = self.WORDBYTES * 4
        if len(salt) < saltsize:
            salt = (chr(0) * (saltsize - len(salt)) + salt)
        else:
            salt = salt[-saltsize:]
        self.salt[0] = self.byte2int(salt[: 4 << self.mul])
        self.salt[1] = self.byte2int(salt[4 << self.mul: 8 << self.mul])
        self.salt[2] = self.byte2int(salt[8 << self.mul:12 << self.mul])
        self.salt[3] = self.byte2int(salt[12 << self.mul:])
def addsalt ( self , salt ) : if self . state != 1 : raise Exception ( 'addsalt() not called after init() and before update()' ) saltsize = self . WORDBYTES * 4 if len ( salt ) < saltsize : salt = ( chr ( 0 ) * ( saltsize - len ( salt ) ) + salt ) else : salt = salt [ - saltsize : ] self . salt [ 0 ] = self . byte2int ( salt [ : 4 << self . mul ] ) self . salt [ 1 ] = self . byte2int ( salt [ 4 << self . mul : 8 << self . mul ] ) self . salt [ 2 ] = self . byte2int ( salt [ 8 << self . mul : 12 << self . mul ] ) self . salt [ 3 ] = self . byte2int ( salt [ 12 << self . mul : ] )
adds a salt to the hash function (OPTIONAL)
should be called AFTER Init, and BEFORE update
salt:  a bytestring, length determined by hashbitlen.
adds a salt to the hash function ( OPTIONAL ) should be called AFTER Init and BEFORE update salt : a bytestring length determined by hashbitlen .
""" adds a salt to the hash function (OPTIONAL)
            should be called AFTER Init, and BEFORE update
            salt:  a bytestring, length determined by hashbitlen.
                   if not of sufficient length, the bytestring
                   will be assumed to be a big endian number and
                   prefixed with an appropriate number of null
                   bytes, and if too large, only the low order
                   bytes will be used.

              if hashbitlen=224 or 256, then salt will be 16 bytes
              if hashbitlen=384 or 512, then salt will be 32 bytes
        """ # fail if addsalt() was not called at the right time # salt size is to be 4x word size # if too short, prefix with null bytes.  if too long, # truncate high order bytes # prep the salt array
self
salt