#NEWLINE# def steady_encrypt( self , plaintext ) : #NEWLINE# #INDENT# assert ( len ( self . Ks ) > 0 ) #NEWLINE# encode = CryptoEnc ( ) . encode #NEWLINE# gcm_enc = self . aes . quick_gcm_enc #NEWLINE# md = sha1 ( ( self . Ks [ ( - 1 ) ] + plaintext ) ) . digest ( ) #NEWLINE# ( r , s ) = do_ecdsa_sign ( self . G , self . priv_sign , md ) #NEWLINE# inner_message = [ B ( self . name . encode ( 'utf8' ) ) , B ( plaintext ) , r , s ] #NEWLINE# plain_inner = encode ( inner_message ) . encode ( 'utf8' ) #NEWLINE# iv = bytes ( urandom ( 16 ) ) #NEWLINE# ( ciphertext , tag ) = gcm_enc ( self . Ks [ ( - 1 ) ] , iv , plain_inner ) #NEWLINE# return encode ( [ B ( iv ) , B ( ciphertext ) , B ( tag ) ] )