由于 Ed25519 出现的时间不长(在 JDK 中),因此关于如何使用它的资源很少。
虽然他们的示例非常简洁和有用,但我在理解密钥解析方面做错了什么时遇到了一些困难。
他们的公钥是从 iDevice 发送的数据包中读取的。
(这么说吧,它是一个字节数组)
通过搜索并尽力了解密钥的编码方式,我偶然发现了这条消息。
4. The public key A is the encoding of the point [s]B. First,
encode the y-coordinate (in the range 0 <= y < p) as a little-
endian string of 32 octets. The most significant bit of the
final octet is always zero. To form the encoding of the point
[s]B, copy the least significant bit of the x coordinate to the
most significant bit of the final octet. …Run Code Online (Sandbox Code Playgroud) 如果变量是int,是否可以在kotlin中设置getter以返回int的双重insted?
没有宣布新的功能.
var x = 0
get() = x.toDouble()
Run Code Online (Sandbox Code Playgroud)