rust-paillier
rust-paillier copied to clipboard
Serialization for BigInts is redefined to be in base 10 instead of 16
I noticed that the crate redefines serialization of curv::BigInt
s to be in base 10, e.g.,
for KeyPair
, p
and q
are going to be in base 10
https://github.com/ZenGo-X/rust-paillier/blob/7d4958fb73cdae283906449e71f0dbb10ff459b3/src/lib.rs#L23-L29
because
https://github.com/ZenGo-X/rust-paillier/blob/7d4958fb73cdae283906449e71f0dbb10ff459b3/src/serialize.rs#L9-L11
while in the curv
crate BigInt
s are serialized using base 16
https://github.com/ZenGo-X/curv/blob/78cac40a47e145eb845d687cc748f9312d999db9/src/arithmetic/serde_support.rs#L9-L21
Imagine a server defines a struct as such
#[derive(Serialize, Deserialize)]
struct S {
b: curv::BigInt,
ek: EncryptionKey
}
then a third-party app needs to selectively serialize BigInt
s of the corresponding fields.
What was the reason behind that?