Switch 2: BCH: Difference between revisions

Created page with "= NvBootComponentHeader = {| class="wikitable" border="1" |- ! Offset ! Size ! Name ! Description |- | 0x0000 || 4 || HeaderMagic || |- | 0x0004 || 0x40 || OuterDigest || |- | style="background: orange" | Outer Section Begin | style="background: orange" | | style="background: orange" | | style="background: orange" | |- | 0x0044 || 0xC || Reserved || |- | 0x0050 || 0x40 || InnerDigest || |- | 0x0090 || 0x40 || Stage2Signature || |- | 0x0BA0..."
 
No edit summary
Line 4: Line 4:
! Offset
! Offset
! Size
! Size
! Name
! Description
! Description
|-
|-
| 0x0000 || 4 || HeaderMagic ||
| 0x0 || 0x4 || HeaderMagic
|-
|-
| 0x0004 || 0x40 || OuterDigest ||
| 0x4 || 0x40 || OuterDigest
|-
|-
| style="background: orange" | Outer Section Begin
| style="background: red" | Outer Section Begin
| style="background: orange" |  
| style="background: red" |  
| style="background: orange" |  
| style="background: red" |  
| style="background: orange" |  
|-
| 0x44 || 0xC || Reserved
|-
|-
| 0x0044 || 0xC || Reserved ||
| 0x50 || 0x40 || InnerDigest
|-
|-
| 0x0050 || 0x40 || InnerDigest ||
| 0x90 || 0xB10 || [[#NvBootCryptoSignatures|Stage2Signature]]
|-
|-
| 0x0090 || 0x40 || [[#NvBootCryptoSignatures|Stage2Signature]] ||
| 0xBA0 || 0x180 || [[#NvPublicKeyParameters|Stage2Pcp]]
|-
|-
| 0x0BA0 || 0x180 || [[#NvPublicKeyParameters|Stage2Pcp]] || Pinned by fuses.
| 0xD20 || 0x2A0 ||
|-
|-
| style="background: orange" | Stage 2 Signed Section Begin  
| style="background: orange" | Stage 2 Signed Section Begin  
| style="background: orange" |  
| style="background: orange" |  
| style="background: orange" |  
| style="background: orange" |  
| style="background: orange" |
|-
|-
| 0x0FC0 || 16 || Salt2 || Random 16 bytes.
| 0xFC0 || 0x10 || Stage2Iv
|-
| 0xFD0 || 0x10 || Stage2Ecid
|-
| 0xFE0 || 0x4 || Stage2NumBinaries
|-
| 0xFE4 || 0x10 || Stage2EcidHash
|-
| 0xFF4 || 0xF0 ||  
|-
|-
| 0x0FD0 || 16 || Stage2Ecid ||  
| 0x10E4 || 0x30C ||  
|-
|-
| 0x0FE0 || 4 || Stage2NumBinaries ||  
| 0x13F0 || 0x8 || BlDerStr (must match BlDerStr from [[Switch_2:_BCT#BRBCT|BRBCT]])
|-
|-
| 0x0FE4 || 0x100 || ? ||  
| 0x13F8 || 0x8 || FwDerStr
|-
|-
| 0x13F0 || 8 || BrbctBinding || Must match BR-BCT+0x19B0.
| 0x1400 || 0x500 (0xA0 *8) || [[#NvStage2Component|Stage2Components]][8]
|-
|-
| 0x1400 || 8 * 0xA0 || [[#NvStage2Component|Stage2Components]][8] ||
| 0x1900 || 0x180 || Stage1Signature (always RSA-3072)
|-
|-
| 0x1900 || 0x180 || Stage1Signature || Always RSA-3072.
| style="background: yellow" | Stage 1 Signed Section Begin
| style="background: yellow" |  
| style="background: yellow" |  
|-
|-
| style="background: orange" | Stage 1 Signed Section Begin
| 0x1A80 || 0x10 || Stage1Iv
| style="background: orange" |  
| style="background: orange" |
| style="background: orange" |  
|-
|-
| 0x1A80 || 16 || Salt3 ||
| 0x1A90 || 0x10 || Stage1Ecid
|-
|-
| 0x1A90 || 16 || Stage1Ecid ||  
| 0x1AA0 || 0x4 || Stage1NumBinaries
|-
|-
| 0x1AA0 || 4 || Stage1NumBinaries ||  
| 0x1AA4 || 0x8 || Key7KdfLabel
|-
|-
| 0x1AA4 || 8 || Key7KdfLabel ||  
| 0x1EE0 || 0x120 (0x90 * 2) || [[#NvStage1Component|Stage1Components]][2]
|-
|-
| 0x1EE0 || 1 * 0x90 || [[#NvStage1Component|Stage1Components]][1] ||
| style="background: yellow" | Stage 1 Signed Section End
| style="background: yellow" |  
| style="background: yellow" |  
|-
|-
| style="background: orange" | Outer Section End / Stage 2 Signed Section End / Stage 1 Signed Section End
| style="background: orange" | Stage 2 Signed Section End
| style="background: orange" |
| style="background: orange" |  
| style="background: orange" |  
| style="background: orange" |  
| style="background: orange" |  
|-
| style="background: red" | Outer Section End
| style="background: red" |
| style="background: red" |
|}
|}


Line 69: Line 80:
! Offset
! Offset
! Size
! Size
! Name
! Description
|-
|-
| style="background: orange" | AAD Section Start
| style="background: orange" | AAD Section Start
Line 75: Line 86:
| style="background: orange" |  
| style="background: orange" |  
|-
|-
| 0x0 || 4 || BinaryMagic
| 0x0 || 0x4 || BinaryMagic
|-
|-
| 0x4 || 4 || BinaryLen
| 0x4 || 0x4 || BinaryLen
|-
|-
| 0x8 || 4 || LoadDestination
| 0x8 || 0x4 || LoadDestination
|-
|-
| 0xC || 4 || EntryPoint
| 0xC || 0x4 || EntryPoint
|-
|-
| 0x10 || 4 || [[#NvBootComponentVersion|Version]]
| 0x10 || 0x4 || [[#NvBootComponentVersion|Version]]
|-
|-
| 0x14 || 4 || Reserved  
| 0x14 || 0x4 || Reserved  
|-
|-
| 0x18 || 8 || PartitionOffset (Only used for MEM-BCT)
| 0x18 || 0x8 || PartitionOffset (only used for MEM-BCT)
|-
|-
| 0x20 || 16 || KdfLabel
| 0x20 || 0x10 || DerStr
|-
|-
| 0x30 || 4 || Zeroes
| 0x30 || 0x4 ||  
|-
|-
| 0x34 || 12 || GcmIv
| 0x34 || 0xC || Iv
|-
|-
| style="background: orange" | AAD Section End
| style="background: orange" | AAD Section End
Line 99: Line 110:
| style="background: orange" |  
| style="background: orange" |  
|-
|-
| 0x40 || 16 || GcmAuthTag
| 0x40 || 0x10 || AuthTag
|-
|-
| 0x50 || 64 || PayloadDigest (SHA512 of 0x2000..)
| 0x50 || 0x40 || PayloadDigest (SHA512 of 0x2000..)
|}
|}


Line 109: Line 120:
! Offset
! Offset
! Size
! Size
! Name
! Description
|-
|-
| style="background: orange" | AAD Section Start
| style="background: orange" | AAD Section Start
Line 115: Line 126:
| style="background: orange" |  
| style="background: orange" |  
|-
|-
| 0x0 || 4 || BinaryMagic
| 0x0 || 0x4 || BinaryMagic
|-
| 0x4 || 0x4 || BinaryLen
|-
| 0x8 || 0x4 || LoadDestination
|-
| 0xC || 0x4 || EntryPoint
|-
| 0x10 || 0x4 || [[#NvBootComponentVersion|Version]]
|-
| 0x14 || 0x4 ||
|-
| 0x18 || 0x4 ||
|-
|-
| 0x4 || 4 || BinaryLen
| 0x1C || 0x4 ||  
|-
|-
| 0x8 || 4 || LoadDestination
| 0x20 || 0x4 ||  
|-
|-
| 0xC || 4 || EntryPoint
| 0x24 || 0x4 ||  
|-
|-
| 0x10 || 4 || [[#NvBootComponentVersion|Version]]
| 0x28 || 0x4 ||  
|-
|-
| 0x24 || 0x1C || ?
| 0x2C || 0x4 || Flags
|-
|-
| 0x30 || 16 || KdfLabel
| 0x30 || 0x10 || DerStr
|-
|-
| 0x40 || 4 || Zeroes
| 0x40 || 0x4 ||  
|-
|-
| 0x44 || 12 || GcmIv
| 0x44 || 0xC || Iv
|-
|-
| style="background: orange" | AAD Section End
| style="background: orange" | AAD Section End
Line 137: Line 160:
| style="background: orange" |  
| style="background: orange" |  
|-
|-
| 0x50 || 16 || GcmAuthTag
| 0x50 || 0x10 || AuthTag
|-
|-
| 0x60 || 64 || PayloadDigest (SHA512 of 0x2000..)
| 0x60 || 0x40 || PayloadDigest (SHA512 of 0x2000..)
|}
|}


Line 147: Line 170:
! Offset
! Offset
! Size
! Size
! Name
! Description
|-
|-
| 0x0 || 1 || Major
| 0x0 || 1 || Major
Line 165: Line 188:
! Offset
! Offset
! Size
! Size
! Name
! Description
|-
|-
| 0x0 || 0x20 || Sha256Signature
| 0x0 || 0x20 || Sha256Signature