tweetnacl -- nacl.box.keyPair.fromSecretKey 期望什么输入?

问题描述 投票:0回答:1

我对 tweetnacl 的 API 有点困惑。除 SecretKey 参数之外的函数

nacl.box.keyPair.fromSecretKey
是否已被限制?或者提供随机字节字符串可以吗?按照我阅读代码的方式,tweetnacl 稍后会进行夹紧,对吗?那么tweetNacl中的
secretKey
总是随机字节字符串并且钳位是在内部库函数中完成的吗?

javascript elliptic-curve x25519 tweet-nacl
1个回答
1
投票

正确,您不需要担心25519夹紧。

图书馆处理这个问题。您只需提供一个均匀随机的 256 位字节数组即可。

© www.soinside.com 2019 - 2024. All rights reserved.