gpt4 book ai didi

rust - 为什么Serde不能用于Libra的加密目的序列化和反序列化?

转载 作者:行者123 更新时间:2023-12-03 11:36:57 25 4
gpt4 key购买 nike

In Libra, participants pass around messages or data structures that often times need to be signed by a prover and verified by one or more verifiers. Serialization in this context refers to the process of converting a message into a byte array. Many serialization approaches support loose standards such that two implementations can produce two different byte streams that would represent the same, identical message. While for many applications, non-deterministic serialization causes no issues, it does so for applications using serialization for cryptographic purposes. For example, given a signature and a message, a verifier may not unable to produce the same serialized byte array constructed by the prover when the prover signed the message resulting in a non-verifiable message. In other words, to ensure message verifiability when using non-deterministic serialization, participants must either retain the original serialized bytes or risk losing the ability to verify messages. This creates a burden requiring participants to maintain both a copy of the serialized bytes and the deserialized message often leading to confusion about safety and correctness. While there exist a handful of existing deterministic serialization formats, there is no obvious choice. To address this, we propose Libra Canonical Serialization that defines a deterministic means for translating a message into bytes.


那是 what the Libra project says。什么是真正的确定性序列化?如果serde不是确定性的,在序列化数据结构后如何反序列化?

最佳答案

HashSetHashMap可以根据插入,更新和删除的确切顺序将项目插入不同的插槽。这些数据结构的序列化器以插槽顺序运行,发出一系列(键,值)对。由于插槽顺序是不确定的,因此序列化的字节将是不确定的。

关于rust - 为什么Serde不能用于Libra的加密目的序列化和反序列化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64019828/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com