Skip to content
This repository was archived by the owner on Dec 24, 2023. It is now read-only.
This repository was archived by the owner on Dec 24, 2023. It is now read-only.

Checksum field and method for computation #11

Open
@ChristopherRabotin

Description

@ChristopherRabotin

In the specs, it would be extremely useful to provide a checksum field early into the file. The checksum should be computed for the subsequent data (i.e. metadata excluded). Moreover, a function shall be provided to recompute this checksum.

The purpose of this checksum is to allow for rapid verification of the integrity of the data, it shall not be used for signing the data. As such, the CRC32 hashing function is proposed (specifically the cdc32fast crate).

Proposed signatures

This is only valid in an Anise context, i.e. with a loaded Anise file.

impl Anise {
   /// Returns the rotation quaternion and the body rate vector
   pub fn verify_checksum(&self) -> Result<(), AniseError>;
}

The following AniseError enum variant is proposed:

pub enum  AniseError {
// ...
  /// Error returned if the checksum in the Anise file does not match the one computed by reading the file
  InvalidChecksum {expected: u32, computed: u32}
}

Proposed usage

This can be used onboard in a guidance loop to ensure that the data is valid at each new guidance loop iteration, and if it isn't, a backup file can be loaded from another disk for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposedA proposed functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions