Module: kdf_chain
- class doubleratchet.kdf_chain.KDFChain[source]
Bases:
objectThe term KDF chain is used when some of the output from a KDF is used as an output key and some is used to replace the KDF key, which can then be used with another input.
https://signal.org/docs/specifications/doubleratchet/#kdf-chains
- property model: KDFChainModel
Returns: The internal state of this
KDFChainas a pydantic model.
- property json: JSONObject
Returns: The internal state of this
KDFChainas a JSON-serializable Python object.
- classmethod from_model(model, kdf)[source]
- Parameters:
model (
KDFChainModel) – The pydantic model holding the internal state of aKDFChain, as produced bymodel.
- Return type:
TypeVar(KDFChainTypeT, bound= KDFChain)- Returns:
A configured instance of
KDFChain, with internal state restored from the model.
Warning
Migrations are not provided via the
model/from_model()API. Usejson/from_json()instead. Refer to Serialization and Migration in the documentation for details.
- classmethod from_json(serialized, kdf)[source]