pub fn update_static_fields(&mut self, config: &ParsedConfig) {
        // TODO: checks to make sure that the config values (strings) are not
        //       bigger than the actual field size.

        let mut update = |value, offset| {
            let bytes = str_to_vec_u8(value);
            self.update_field(&bytes, offset);
        };

        update(
            &config.manifest_identifier,
            manifest::ROM_EXT_MANIFEST_IDENTIFIER_OFFSET,
        );
        update(
            &config.image_version,
            manifest::ROM_EXT_IMAGE_VERSION_OFFSET,
        );

        let offsets = [
            (
                manifest::ROM_EXT_EXTENSION0_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION0_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION1_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION1_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION2_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION2_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION3_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION3_CHECKSUM_OFFSET,
            ),
        ];
        for (i, offset) in offsets.iter().enumerate() {
            update(&config.extensions[i].offset, offset.0);
            update(&config.extensions[i].checksum, offset.1);
        }

        let usage_constraints_path = &config.input_files.usage_constraints_path;
        self.update_usage_constraints_field(usage_constraints_path);

        let lockdown_info = &config.peripheral_lockdown_info;
        self.update_peripheral_lockdown_info_field(lockdown_info);

        // TODO: calculated at runtime, so we should probably rename this
        //       function.
        self.update_timestamp_field();
    }
/// Updates the fields from the configuration file.
///
/// This function updates the image manifest data with values parsed from
/// the configuration file (known ahead of time). Some of the other fields
/// like signature key public exponent and modulus, are obtained at
/// run-time.
Updates the fields from the configuration file.
This function updates the image manifest data with values parsed from
the configuration file (known ahead of time). Some of the other fields
like signature key public exponent and modulus, are obtained at
run-time.
Updates the fields from the configuration file . This function updates the image manifest data with values parsed from the configuration file ( known ahead of time ) . Some of the other fields like signature key public exponent and modulus are obtained at run - time .
pub fn update_static_fields(&mut self, config: &ParsedConfig) {
        // TODO: checks to make sure that the config values (strings) are not
        //       bigger than the actual field size.
        let mut update = |value, offset| {
            let bytes = str_to_vec_u8(value);
            self.update_field(&bytes, offset);
        };
        update(
            &config.manifest_identifier,
            manifest::ROM_EXT_MANIFEST_IDENTIFIER_OFFSET,
        );
        update(
            &config.image_version,
            manifest::ROM_EXT_IMAGE_VERSION_OFFSET,
        );
        let offsets = [
            (
                manifest::ROM_EXT_EXTENSION0_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION0_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION1_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION1_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION2_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION2_CHECKSUM_OFFSET,
            ),
            (
                manifest::ROM_EXT_EXTENSION3_OFFSET_OFFSET,
                manifest::ROM_EXT_EXTENSION3_CHECKSUM_OFFSET,
            ),
        ];
        for (i, offset) in offsets.iter().enumerate() {
            update(&config.extensions[i].offset, offset.0);
            update(&config.extensions[i].checksum, offset.1);
        }
        let usage_constraints_path = &config.input_files.usage_constraints_path;
        self.update_usage_constraints_field(usage_constraints_path);
        let lockdown_info = &config.peripheral_lockdown_info;
        self.update_peripheral_lockdown_info_field(lockdown_info);
        // TODO: calculated at runtime, so we should probably rename this
        //       function.
        self.update_timestamp_field();
    }
pub fn update_static_fields ( & mut self , config : & ParsedConfig ) { // TODO: checks to make sure that the config values (strings) are not //       bigger than the actual field size. let mut update = | value , offset | { let bytes = str_to_vec_u8 ( value ) ; self . update_field ( & bytes , offset ) ; } ; update ( & config . manifest_identifier , manifest :: ROM_EXT_MANIFEST_IDENTIFIER_OFFSET , ) ; update ( & config . image_version , manifest :: ROM_EXT_IMAGE_VERSION_OFFSET , ) ; let offsets = [ ( manifest :: ROM_EXT_EXTENSION0_OFFSET_OFFSET , manifest :: ROM_EXT_EXTENSION0_CHECKSUM_OFFSET , ) , ( manifest :: ROM_EXT_EXTENSION1_OFFSET_OFFSET , manifest :: ROM_EXT_EXTENSION1_CHECKSUM_OFFSET , ) , ( manifest :: ROM_EXT_EXTENSION2_OFFSET_OFFSET , manifest :: ROM_EXT_EXTENSION2_CHECKSUM_OFFSET , ) , ( manifest :: ROM_EXT_EXTENSION3_OFFSET_OFFSET , manifest :: ROM_EXT_EXTENSION3_CHECKSUM_OFFSET , ) , ] ; for ( i , offset ) in offsets . iter ( ) . enumerate ( ) { update ( & config . extensions [ i ] . offset , offset . 0 ) ; update ( & config . extensions [ i ] . checksum , offset . 1 ) ; } let usage_constraints_path = & config . input_files . usage_constraints_path ; self . update_usage_constraints_field ( usage_constraints_path ) ; let lockdown_info = & config . peripheral_lockdown_info ; self . update_peripheral_lockdown_info_field ( lockdown_info ) ; // TODO: calculated at runtime, so we should probably rename this //       function. self . update_timestamp_field ( ) ; }
Updates the fields from the configuration file.
Updates the fields from the configuration file .
&mut self
config
&ParsedConfig
&mut self
config
&ParsedConfig