fn make_ecdsa_signature_space(&mut self) -> u32 {
        if let SignatureType::EcdsaP256 = self.app_props.signature_type {
            if self.app_props.signature_location != 0 {
                // signature already present
                return self.app_props.signature_location;
            }
        }

        // Allocate a new signature at the very end of the app image
        let location = self.raw.len() as u32;

        // Reallocate raw image buffer, allocating 0s for signature
        let mut raw = vec![0; self.raw.len() + 64];
        raw[..self.raw.len()].copy_from_slice(&self.raw);

        // Modify app props accordingly and write them back
        self.app_props.signature_type = SignatureType::EcdsaP256;
        self.app_props.signature_location = location;

        let props_pos = self.app_props_pos as usize;
        self.app_props
            .write(&mut &mut raw[props_pos..props_pos + AppProperties::LENGTH])
            .expect("serializing properties to byte slice failed");

        // Now use the larger buffer as the raw image
        self.raw = Blob(Cow::Owned(raw));

        location
    }
/// Returns the existing signature space, or allocates a new signature at
/// the end of the image.
///
/// When allocating new space for the signature, this will update the
/// application property structure inside the raw data.
///
/// Returns the position of the signature data.
Returns the existing signature space, or allocates a new signature at
the end of the image.

When allocating new space for the signature, this will update the
application property structure inside the raw data.

Returns the position of the signature data.
Returns the existing signature space or allocates a new signature at the end of the image . When allocating new space for the signature this will update the application property structure inside the raw data . Returns the position of the signature data .
fn make_ecdsa_signature_space(&mut self) -> u32 {
        if let SignatureType::EcdsaP256 = self.app_props.signature_type {
            if self.app_props.signature_location != 0 {
                // signature already present
                return self.app_props.signature_location;
            }
        }
        // Allocate a new signature at the very end of the app image
        let location = self.raw.len() as u32;
        // Reallocate raw image buffer, allocating 0s for signature
        let mut raw = vec![0; self.raw.len() + 64];
        raw[..self.raw.len()].copy_from_slice(&self.raw);
        // Modify app props accordingly and write them back
        self.app_props.signature_type = SignatureType::EcdsaP256;
        self.app_props.signature_location = location;
        let props_pos = self.app_props_pos as usize;
        self.app_props
            .write(&mut &mut raw[props_pos..props_pos + AppProperties::LENGTH])
            .expect("serializing properties to byte slice failed");
        // Now use the larger buffer as the raw image
        self.raw = Blob(Cow::Owned(raw));
        location
    }
fn make_ecdsa_signature_space ( & mut self ) -> u32 { if let SignatureType :: EcdsaP256 = self . app_props . signature_type { if self . app_props . signature_location != 0 { // signature already present return self . app_props . signature_location ; } } // Allocate a new signature at the very end of the app image let location = self . raw . len ( ) as u32 ; // Reallocate raw image buffer, allocating 0s for signature let mut raw = vec ! [ 0 self raw len ( ) 64 ] ; raw [ .. self . raw . len ( ) ] . copy_from_slice ( & self . raw ) ; // Modify app props accordingly and write them back self . app_props . signature_type = SignatureType :: EcdsaP256 ; self . app_props . signature_location = location ; let props_pos = self . app_props_pos as usize ; self . app_props . write ( & mut & mut raw [ props_pos .. props_pos + AppProperties :: LENGTH ] ) . expect ( " " ) ; // Now use the larger buffer as the raw image self . raw = Blob ( Cow :: Owned ( raw ) ) ; location }
Returns the existing signature space, or allocates a new signature at
the end of the image.
Returns the existing signature space or allocates a new signature at the end of the image .
&mut self