Exemplo n.º 1
0
 public Streamcipher(BlockcipherKind algorithm, BlockcipherModeKind mode, int max_workers)
 {
     if (UnmanagedError.RegisterThread() != ErrorKind.K_ESUCCESS)
         throw new Exception("unable to register libk error handler");
     if ((context = SafeNativeMethods.k_sc_init_with_blockcipher(algorithm, mode, (UIntPtr)max_workers)) == (UIntPtr)0)
         UnmanagedError.ThrowLastError();
 }
Exemplo n.º 2
0
 public Streamcipher(BlockcipherKind algorithm, BlockcipherModeKind mode)
     : this(algorithm, mode, 0)
 {
 }
Exemplo n.º 3
0
 internal static extern UIntPtr k_sc_init_with_blockcipher(BlockcipherKind cipher, BlockcipherModeKind mode, UIntPtr max_workers);
Exemplo n.º 4
0
 internal static extern int k_bcmode_set_mode(UIntPtr context, BlockcipherModeKind mode, Int32 max_workers);
Exemplo n.º 5
0
 public void SetMode(BlockcipherModeKind mode)
 {
     SetMode(mode, 0);
 }
Exemplo n.º 6
0
 public void SetMode(BlockcipherModeKind mode, int max_workers)
 {
     if (SafeNativeMethods.k_bcmode_set_mode(context, mode, max_workers) != 0)
         UnmanagedError.ThrowLastError();
 }