Exemple #1
0
 public static Xts Create(byte[] key)
 {
     Xts.VerifyKey(512, key);
     byte[] array  = new byte[32];
     byte[] array2 = new byte[32];
     Buffer.BlockCopy(key, 0, array, 0, 32);
     Buffer.BlockCopy(key, 32, array2, 0, 32);
     return(new XtsAes256(Aes.Create, array, array2));
 }
 public static Xts Create(byte[] key)
 {
     Xts.VerifyKey(256, key);
     byte[] array  = new byte[16];
     byte[] array2 = new byte[16];
     Buffer.BlockCopy(key, 0, array, 0, 16);
     Buffer.BlockCopy(key, 16, array2, 0, 16);
     return(new XtsAes128(Aes.Create, array, array2));
 }
Exemple #3
0
 public XtsStream(Stream baseStream, Xts xts)
     : this(baseStream, xts, 512)
 {
 }
Exemple #4
0
 public XtsStream(Stream baseStream, Xts xts, int sectorSize, long offset)
     : base(new XtsSectorStream(baseStream, xts, sectorSize, offset), true)
 {
 }
Exemple #5
0
 public XtsStream(Stream baseStream, Xts xts, int sectorSize)
     : base(new XtsSectorStream(baseStream, xts, sectorSize), true)
 {
 }
Exemple #6
0
 /// <summary>
 ///     Creates a new stream
 /// </summary>
 /// <param name="baseStream">The base stream</param>
 /// <param name="xts">The xts transform</param>
 /// <param name="sectorSize">Sector size</param>
 /// <param name="offset">Offset to start counting sectors</param>
 public XtsSectorStream(Stream baseStream, Xts xts, int sectorSize, long offset)
     : base(baseStream, sectorSize, offset)
 {
     _xts        = xts;
     _tempBuffer = new byte[sectorSize];
 }
Exemple #7
0
 /// <summary>
 ///     Creates a new stream
 /// </summary>
 /// <param name="baseStream">The base stream</param>
 /// <param name="xts">The xts transform</param>
 /// <param name="sectorSize">Sector size</param>
 public XtsSectorStream(Stream baseStream, Xts xts, int sectorSize)
     : this(baseStream, xts, sectorSize, 0)
 {
 }
Exemple #8
0
 /// <summary>
 ///     Creates a new stream with the default sector size
 /// </summary>
 /// <param name="baseStream">The base stream</param>
 /// <param name="xts">The xts transform</param>
 public XtsSectorStream(Stream baseStream, Xts xts)
     : this(baseStream, xts, DEFAULT_SECTOR_SIZE)
 {
 }
Exemple #9
0
 public static Xts Create(byte[] key1, byte[] key2)
 {
     Xts.VerifyKey(256, key1);
     Xts.VerifyKey(256, key2);
     return(new XtsAes256(Aes.Create, key1, key2));
 }
Exemple #10
0
 protected XtsAes256(Func <SymmetricAlgorithm> create, byte[] key1, byte[] key2)
     : base(create, Xts.VerifyKey(256, key1), Xts.VerifyKey(256, key2))
 {
 }
Exemple #11
0
 public VideoCacheDownloadOperationOutputWithEncryption(StorageFile destinationFile, XTSSharp.Xts xts)
 {
     _destinationFile = destinationFile;
     _xts             = xts;
 }