Example #1
0
        public override PACSAMKeyRecord Clone(bool includeKey = false)
        {
            PACSAMTDEA2KeyRecord instance = new PACSAMTDEA2KeyRecord();

            CopyTo(instance, includeKey);
            return(instance);
        }
Example #2
0
        public override void ExportParts(params PACSAMKeyRecord[] parts)
        {
            // There must be at least 3 or more parts
            if (parts.Length < 3)
            {
                throw new ArgumentException(@"ExportParts: There must be at 3 or more parts to export to!");
            }

            // Create part 0
            parts[0] = new PACSAMTDEA2KeyRecord(this);

            // Iterate through the parts from 1 to n (skipping the first, which will hold the XOR result)
            for (int i = 1; i < parts.Length; i++)
            {
                // Generate the part
                parts[i] = new PACSAMTDEA2KeyRecord(this);

                var pI = (parts[i] as PACSAMTDEA2KeyRecord);
                var p0 = (parts[0] as PACSAMTDEA2KeyRecord);

                pI.Value = Crypto.CreateRandomEntropy(Value.Length);
                p0.Value = Crypto.XorArray(p0.Value, pI.Value);
            }
        }
Example #3
0
 public PACSAMTDEA2KeyRecord(PACSAMTDEA2KeyRecord copyObject)
 {
     copyObject.CopyTo(this, true);
 }