<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>_o/<br></div><div><br></div><div>We don't remove deprecated APIs. x/crypto follows the Go 1 Compatibility Promise. See <a href="https://golang.org/wiki/Deprecated">https://golang.org/wiki/Deprecated</a>.<br></div><div><br></div><div>Indeed, this deprecation is due mostly to contributory behavior. The X25519 APIs have been discussed at length, so I won't rehash the debate, but I'll mention that there were real-world security vulnerabilities due to the old API behavior. Note that the Noise spec has the equivalent of a MAY for checking low order points:<br></div><div><br></div><div>> Alternatively, implementations are allowed to detect inputs that produce
 an all-zeros output and signal an error instead. This behavior is 
discouraged because it adds complexity and implementation variance, and 
does not improve security. This behavior is allowed because it might 
match the behavior of some software.<br></div><div>> <a href="https://noiseprotocol.org/noise.html#the-25519-dh-functions">https://noiseprotocol.org/noise.html#the-25519-dh-functions</a><br></div><div><br></div><div>The new API also uses slices, which is generally more ergonomic, saves copies of secret material, and most importantly avoids silently copying a short buffer into a fixed size array.<br></div><div><br></div><div>All in all, a Noise implementation is probably going to be fine with either.<br></div><div><br></div><div>2021-08-14 09:23 GMT+02:00 Nadim Kobeissi <<a href="mailto:nadim.kobeissi@outlook.com">nadim.kobeissi@outlook.com</a>>:<br></div><blockquote type="cite" id="qt" style=""><div>Hello everyone,<br></div><div><br></div><div>I’ve looked through the exchange between John and Yawning and I understand the issue better now.<br></div><div><br></div><div>A look at ScalarMult indicates that Yawning is correct: its deprecation has to do entirely with ensuring “contributory behavior” to mitigate for low-order points. To quote: "Deprecated: when provided a low-order point, ScalarMult will set dst to all zeroes, irrespective of the scalar. Instead, use the X25519 function, which will return an error.” [1]<br></div><div><br></div><div>I agree with Yawning that if this is the only reason for the deprecation of ScalarMult, then no change should be made to the current Go-generated Noise Explorer code. This is for two reasons:<br></div><div>1. RFC 7748 marks the low-order point check as optional.<br></div><div>2. Trevor has repeatedly expressed his opinion which seems to oppose APIs which return errors on low-order points. So this should be Trevor’s call and not mine.<br></div><div><br></div><div>However there is still one important concern. The common definition of “deprecation” in the context of software engineering seems to include the possibility that the deprecated functionality will be removed entirely in future software updates. [2] It would be good if Filippo (who `git blame` indicates is responsible for this deprecation in 2019 [3]) could shed light on whether ScalarMult is scheduled for removal in the future. In that case, there would need to be some alternative code to the Go crypto API such that the low-order point check could be bypassed in order to keep with the current targeted behavior for Noise Handshake Pattern implementations. Or, alternatively, Trevor would validate that low-order point checks are not anathema to the intended behavior of Noise Handshake Pattern implementations.<br></div><div><br></div><div>Have a good week-end,<br></div><div><br></div><div>Nadim<br></div><div>Sent from my computer<br></div><div><br></div><div>References:<br></div><div>[1] <a href="https://github.com/golang/crypto/blob/master/curve25519/curve25519.go#L19-L21">https://github.com/golang/crypto/blob/master/curve25519/curve25519.go#L19-L21</a><br></div><div>[2] <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/deprecation/index.html">https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/deprecation/index.html</a><br></div><div>[3] <a href="https://github.com/golang/crypto/commit/f4817d981bb690635456c5c1c6aa0585e5d45891">https://github.com/golang/crypto/commit/f4817d981bb690635456c5c1c6aa0585e5d45891</a><br></div><div><br></div><div>> On 14 Aug 2021, at 12:34 AM, Yawning Angel <<a href="mailto:yawning@schwanenlied.me">yawning@schwanenlied.me</a>> wrote:<br></div><div>> <br></div><div>> On 8/13/21 10:00 PM, Nadim Kobeissi wrote:<br></div><div>>> Noise Explorer author here. I’ll take a close look at this tomorrow. Thanks for your patience everyone.<br></div><div>> There really isn't much to look at.  The new API is more ergonomic, but<br></div><div>> forces contributory behavior by checking if the output is a low-order<br></div><div>> point, and spits out an error.  RFC 7748 has this check as a MAY.  The<br></div><div>> noise spec prefers not having the check (which is what the deprecated<br></div><div>> API does).<br></div><div>> <br></div><div>> As an aside, I misspoke about the parts of the spec, dummy psks don't<br></div><div>> have anything to do with this,  Sorry it's been a while since I've<br></div><div>> thought about this.  I seem to vaguely recall years ago, some explicit<br></div><div>> use case that involved sending the neutral element, but I might just be<br></div><div>> confused.<br></div><div>> <br></div><div>> Regards,<br></div><div>> <br></div><div>> -- <br></div><div>> Yawning Angel<br></div><div>> <br></div><div>> _______________________________________________<br></div><div>> Noise mailing list<br></div><div>> <a href="mailto:Noise@moderncrypto.org">Noise@moderncrypto.org</a><br></div><div>> <a href="https://moderncrypto.org/mailman/listinfo/noise">https://moderncrypto.org/mailman/listinfo/noise</a><br></div><div><br></div><div>_______________________________________________<br></div><div>Noise mailing list<br></div><div><a href="mailto:Noise@moderncrypto.org">Noise@moderncrypto.org</a><br></div><div><a href="https://moderncrypto.org/mailman/listinfo/noise">https://moderncrypto.org/mailman/listinfo/noise</a><br></div><div><br></div></blockquote><div><br></div></body></html>