pub struct WorldCodec { /* private fields */ }Expand description
Stateful Titanium/P99-V62 codec for world approval and file validation.
Implementations§
Source§impl WorldCodec
impl WorldCodec
Sourcepub fn new(login_info: &[u8]) -> Result<WorldCodec, Error>
pub fn new(login_info: &[u8]) -> Result<WorldCodec, Error>
Derive the initial world codec key from the exact login-info packet.
§Errors
Returns an error unless login_info has the 464-byte Titanium layout.
Sourcepub fn approve(&mut self, challenge: &[u8]) -> Result<Vec<u8>, Error>
pub fn approve(&mut self, challenge: &[u8]) -> Result<Vec<u8>, Error>
Answer the world’s approval challenge and initialize rolling state.
§Errors
Returns an error when the challenge is malformed or contains unsupported public-key values.
Sourcepub fn encode_approval(&mut self, body: &mut [u8]) -> Result<(), Error>
pub fn encode_approval(&mut self, body: &mut [u8]) -> Result<(), Error>
Encode an approval body and seed the incoming manifest decoder.
§Errors
Returns an error unless body has the 272-byte approval layout.
Sourcepub fn manifest(&mut self, body: &mut [u8]) -> Result<(), Error>
pub fn manifest(&mut self, body: &mut [u8]) -> Result<(), Error>
Decode the world manifest and seed its checksum response encoder.
§Errors
Returns an error when approval has not initialized the incoming state.
Sourcepub fn file_response(&self, body: &mut [u8]) -> Result<(), Error>
pub fn file_response(&self, body: &mut [u8]) -> Result<(), Error>
Encode a world or zone file-checksum response with rolling state.
§Errors
Returns an error when no manifest has initialized the outgoing state.
Sourcepub fn zone_manifest(&self, handoff: &[u8]) -> Result<Vec<u8>, Error>
pub fn zone_manifest(&self, handoff: &[u8]) -> Result<Vec<u8>, Error>
Decode the file manifest embedded in a world-to-zone handoff.
§Errors
Returns an error when the handoff is too short or its digest input is too large.