def patch_pureSalsa20():

    class Testing_puresalsa20( pureSalsa20.Salsa20 ):

        def salsa20core( self, input, nRounds ):
            assert type( input ) == bytes, 'input must be byte string'
            assert len( input ) == 64, 'input must be 64-byte string'

            # Interpret each four input bytes as a little-endian word,
            # placing into a Python list of ints.
            ctx = little16_i32.unpack( input )
            w2b = pureSalsa20.salsa20_wordtobyte
            return w2b( ctx, nRounds, checkRounds=False )


        def force_nRounds( self, nRounds ):
            """ \
            Set # of rounds bypassing the "in [8,12,20]" check, for testing.
            """
            self.setRounds( nRounds, testing=True )

    # Return the class:
    return Testing_puresalsa20
Define and return a testing version of pureSalsa20's Salsa20 class.
dataset/ETHPy150Open zhansliu/writemdict/testSalsa20.py/patch_pureSalsa20