libcdry: Move and rename PeFile alias

This type alias will also be used in crdyshim.

BUG=b:203705645
TEST=cargo xtask check

Change-Id: Id273811c91f8587ab76108a0d38ce958bc924633
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crdyboot/+/4727444
Tested-by: Nicholas Bishop <nicholasbishop@google.com>
Commit-Queue: Nicholas Bishop <nicholasbishop@google.com>
Reviewed-by: Esther Shimanovich <eshimanovich@google.com>
diff --git a/libcrdy/src/arch.rs b/libcrdy/src/arch.rs
index 360201a..619da18 100644
--- a/libcrdy/src/arch.rs
+++ b/libcrdy/src/arch.rs
@@ -27,3 +27,11 @@
         }
     }
 }
+
+// The PE layout is different between the 32-bit and 64-bit targets.
+// Expose a type alias for a PE file appropriate for the arch of the
+// currently-running executable.
+#[cfg(target_pointer_width = "32")]
+pub type PeFileForCurrentArch<'a> = object::read::pe::PeFile32<'a>;
+#[cfg(target_pointer_width = "64")]
+pub type PeFileForCurrentArch<'a> = object::read::pe::PeFile64<'a>;
diff --git a/libcrdy/src/vbpubk.rs b/libcrdy/src/vbpubk.rs
index 6c988ec..6e23254 100644
--- a/libcrdy/src/vbpubk.rs
+++ b/libcrdy/src/vbpubk.rs
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+use crate::arch::PeFileForCurrentArch;
 use crate::u32_to_usize;
 use core::fmt::{self, Display, Formatter};
 use core::slice;
@@ -68,15 +69,8 @@
 /// The returned slice is valid for as long as boot services are active
 /// (as enforced by the lifetime).
 pub fn get_vbpubk_from_image(boot_services: &BootServices) -> Result<&[u8], VbpubkError> {
-    // The PE layout is different between the 32-bit and 64-bit targets;
-    // make a `PeFile` type alias to the appropriate type.
-    #[cfg(target_pointer_width = "32")]
-    type PeFile<'a> = object::read::pe::PeFile32<'a>;
-    #[cfg(target_pointer_width = "64")]
-    type PeFile<'a> = object::read::pe::PeFile64<'a>;
-
     let image_data = get_loaded_image_data(boot_services)?;
-    let pe = PeFile::parse(image_data).map_err(VbpubkError::InvalidPe)?;
+    let pe = PeFileForCurrentArch::parse(image_data).map_err(VbpubkError::InvalidPe)?;
 
     // Find the target section.
     let section_name = ".vbpubk";