Greetings people of golang, cryptographers, software architects,
Works great!
Jumping right into the nitty gritty here... We have a "directory authority" protocol (similar to Tor's directory authority protocol) which votes and publishes a "network view" document which contains many MixDescriptor objects, one for each network node (known as a mix).
Each mix published several mix keys for future Epochs in their MixDescriptor. So we have a map of these mix keys, like so:
However, currently the map of keys only stores X25519 keys. But ideally we'd like the MixDescriptor struct to be more accommodating to migrating to hybrid post quantum keys.
How might we accomplish this?
Acceptable solutions will not create intermediary types to represent the entire MixDescriptor... but there should be no objections to intermediary types for representing a single field of the MixDescriptor; like a wrapper type for the map of mix keys?
So we initialize those two fields with valid empty types that implement those interfaces. Fine. But that won't work for a map of interface types, right?
Let's come back to this question soon, and now take a brief digression to discuss katzenpost architecture design:
Backing up a bit, our "directory authority" publishes a document of this type:
which contains many MixDescriptor objects for the entire network:
The Sphinx Geometry describes it's KEM or NIKE:
So I guess my question is: How shall I marshal/unmarshal a map of public keys where the keys themselves can be any type that satisfies our NIKE interface or KEM inteface?
It would be silly to put a bunch of concrete key maps into MixDescriptor. There will always be more KEMs and NIKEs.
It sounds like I need change the MixKeys field of the MixDescriptor to use a wrapper type instead of a map directly. The wrapper type would have it's own UnmarshalBinary/MarshalBinary (so that cbor.Marshal/Unmarshal can be called) which would represent the map as a list of two tuples: key, value. Easy to convert it to a map.
What do you think of this approach?
type KeyValue struct {
Key uint64
Value mixkey.PublicKey
}
...blah blah...
fubar := make([]KeyValue, 123)
cbor.Unmarshal(blob, fubar)
But can this work if mixkey.PublicKey is an interface? Nope. I don't think that works because the nil value of KeyValue struct will have a nil for it's Value field.
Any suggestions?
Cheers,
David