Beispiel #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();
 }
Beispiel #2
0
 public Blockcipher(BlockcipherKind algorithm)
 {
     if (UnmanagedError.RegisterThread() != ErrorKind.K_ESUCCESS)
         throw new Exception("unable to register libk error handler");
     if ((context = SafeNativeMethods.k_bc_init(algorithm)) == (UIntPtr)0)
         UnmanagedError.ThrowLastError();
 }
Beispiel #3
0
 public Streamcipher(BlockcipherKind algorithm, BlockcipherModeKind mode)
     : this(algorithm, mode, 0)
 {
 }
Beispiel #4
0
 internal static extern UIntPtr k_sc_init_with_blockcipher(BlockcipherKind cipher, BlockcipherModeKind mode, UIntPtr max_workers);
Beispiel #5
0
 internal static extern UIntPtr k_bc_init(BlockcipherKind cipher);