parameters: (self, key, nonce)
docstring: Initialize a Salsa20 cipher object
  
          See also `new()` at the module level.
docstring_summary: Initialize a Salsa20 cipher object
docstring_tokens: Initialize a Salsa20 cipher object
function: def __init__(self, key, nonce):
          """Initialize a Salsa20 cipher object
  
          See also `new()` at the module level."""
  
          if len(key) not in key_size:
              raise ValueError("Incorrect key length for Salsa20 (%d bytes)" % len(key))
  
          if len(nonce) != 8:
              raise ValueError("Incorrect nonce length for Salsa20 (%d bytes)" %
                               len(nonce))
  
          self.nonce = _copy_bytes(None, None, nonce)
  
          self._state = VoidPointer()
          result = _raw_salsa20_lib.Salsa20_stream_init(
                          c_uint8_ptr(key),
                          c_size_t(len(key)),
                          c_uint8_ptr(nonce),
                          c_size_t(len(nonce)),
                          self._state.address_of())
          if result:
              raise ValueError("Error %d instantiating a Salsa20 cipher")
          self._state = SmartPointer(self._state.get(),
                                     _raw_salsa20_lib.Salsa20_stream_destroy)
  
          self.block_size = 1
          self.key_size = len(key)
function_tokens: def __init__ ( self , key , nonce ) : if len ( key ) not in key_size : raise ValueError ( "Incorrect key length for Salsa20 (%d bytes)" % len ( key ) ) if len ( nonce ) != 8 : raise ValueError ( "Incorrect nonce length for Salsa20 (%d bytes)" % len ( nonce ) ) self . nonce = _copy_bytes ( None , None , nonce ) self . _state = VoidPointer ( ) result = _raw_salsa20_lib . Salsa20_stream_init ( c_uint8_ptr ( key ) , c_size_t ( len ( key ) ) , c_uint8_ptr ( nonce ) , c_size_t ( len ( nonce ) ) , self . _state . address_of ( ) ) if result : raise ValueError ( "Error %d instantiating a Salsa20 cipher" ) self . _state = SmartPointer ( self . _state . get ( ) , _raw_salsa20_lib . Salsa20_stream_destroy ) self . block_size = 1 self . key_size = len ( key )