Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
So to use it I would have to write a function that calls Encrypt() interface method in assembly. There is even a github project that does exacly that but for io.Reader/io.Writer: https://github.com/lukechampine/noescape. But, I don't know assembly so writing another implementation just for cipher.Block interface didn't seem to be a good idea.
Nice find! Interfaces like this have long been a source of frustration for me. The decision to return an interface rather than a concrete type in much of the standard library -- especially in crypto packages -- was clearly a mistake, but it can't be changed now without breaking the 1.0 promise. There has been some work towards "devirtualizing" interfaces, but that will only work in certain cases.