コード例 #1
0
        private static void Derive620Keys(KeySet s)
        {
            bool haveTsecRootKek    = !s.TsecRootKek.IsZeros();
            bool havePackage1MacKek = !s.Package1MacKek.IsZeros();
            bool havePackage1Kek    = !s.Package1Kek.IsZeros();

            for (int i = KeySet.UsedKeyBlobCount; i < KeySet.KeyRevisionCount; i++)
            {
                if (s.TsecAuthSignatures[i - KeySet.UsedKeyBlobCount].IsZeros())
                {
                    continue;
                }

                if (haveTsecRootKek)
                {
                    Aes.EncryptEcb128(s.TsecAuthSignatures[i - KeySet.UsedKeyBlobCount],
                                      s.TsecRootKeys[i - KeySet.UsedKeyBlobCount], s.TsecRootKek);
                }

                if (havePackage1MacKek)
                {
                    Aes.EncryptEcb128(s.TsecAuthSignatures[i - KeySet.UsedKeyBlobCount], s.Package1MacKeys[i],
                                      s.Package1MacKek);
                }

                if (havePackage1Kek)
                {
                    Aes.EncryptEcb128(s.TsecAuthSignatures[i - KeySet.UsedKeyBlobCount], s.Package1Keys[i], s.Package1Kek);
                }
            }
        }