A Portable And Improved Implementation Of The Diffie-Hellman Protocol For Wireless Sensor Networks