#NEWLINE# def test_3DH( ) : #NEWLINE# #INDENT# G = EcGroup ( ) #NEWLINE# g = G . generator ( ) #NEWLINE# o = G . order ( ) #NEWLINE# ( priv1 , pub1 ) = pair ( pub3 ) #NEWLINE# ( priv2 , pub2 ) = pair ( G ) #NEWLINE# ( priv3 , pub3 ) = pair ( G ) #NEWLINE# ( priv4 , pub4 ) = pair ( G ) #NEWLINE# k1 = derive_3DH_sender ( G , priv1 , priv2 , pub3 , pub4 ) #NEWLINE# k2 = derive_3DH_receiver ( G , pub1 , pub2 , priv3 , priv4 ) #NEWLINE# assert ( k1 == k2 )