You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method KeyExchange(ArraySegment<byte>, ArraySegment<byte>, ArraySegment<byte>) defined in the file Chaos.NaCl/Ed25519.cs performs an unnecessary ScalarOperations.sc_clamp(byte[], int) operation (link with details: Chaos.NaCl/Ed25519.cs on Line 140).
This is beacuse the following line calls MontgomeryOperations.scalarmult(out sharedMontgomeryX, h, 0, ref montgomeryX), which in turn will end calling the very same sc_clamp operation on Chaos.NaCl/Internal/Ed25519Ref10/scalarmult.cs on Line 39.
Simple fix (for a very small performance gain) is to simply remove the unnecessary ScalarOperations.sc_clamp(byte[], int) operation. Already tested and KeyExchange keeps working as expected after removing Chaos.NaCl/Ed25519.cs on Line 140).
The text was updated successfully, but these errors were encountered:
mishamosher
changed the title
KeyExchange test correctness
Ed25519 KeyExchange performance improvement
Jul 6, 2016
The method
KeyExchange(ArraySegment<byte>, ArraySegment<byte>, ArraySegment<byte>)
defined in the fileChaos.NaCl/Ed25519.cs
performs an unnecessaryScalarOperations.sc_clamp(byte[], int)
operation (link with details:Chaos.NaCl/Ed25519.cs
on Line 140).This is beacuse the following line calls
MontgomeryOperations.scalarmult(out sharedMontgomeryX, h, 0, ref montgomeryX)
, which in turn will end calling the very samesc_clamp
operation on Chaos.NaCl/Internal/Ed25519Ref10/scalarmult.cs on Line 39.Simple fix (for a very small performance gain) is to simply remove the unnecessary
ScalarOperations.sc_clamp(byte[], int)
operation. Already tested andKeyExchange
keeps working as expected after removingChaos.NaCl/Ed25519.cs
on Line 140).The text was updated successfully, but these errors were encountered: