<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />

Org.BouncyCastle.Crypto.Modes.OcbBlockCipher

An implementation of RFC 7253 on The OCB Authenticated-Encryption Algorithm.
namespace Org.BouncyCastle.Crypto.Modes { public class OcbBlockCipher : IAeadBlockCipher, IAeadCipher { public virtual string AlgorithmName { get; } public virtual IBlockCipher UnderlyingCipher { get; } public OcbBlockCipher(IBlockCipher hashCipher, IBlockCipher mainCipher); public virtual void Init(bool forEncryption, ICipherParameters parameters); protected virtual int ProcessNonce(byte[] N); public virtual int GetBlockSize(); public virtual byte[] GetMac(); public virtual int GetOutputSize(int len); public virtual int GetUpdateOutputSize(int len); public virtual void ProcessAadByte(byte input); public virtual void ProcessAadBytes(byte[] input, int off, int len); public virtual int ProcessByte(byte input, byte[] output, int outOff); public virtual int ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff); public virtual int DoFinal(byte[] output, int outOff); public virtual void Reset(); protected virtual void Clear(byte[] bs); protected virtual byte[] GetLSub(int n); protected virtual void ProcessHashBlock(); protected virtual void ProcessMainBlock(byte[] output, int outOff); protected virtual void Reset(bool clearMac); protected virtual void UpdateHASH(byte[] LSub); protected static byte[] OCB_double(byte[] block); protected static void OCB_extend(byte[] block, int pos); protected static int OCB_ntz(long x); protected static int ShiftLeft(byte[] block, byte[] output); protected static void Xor(byte[] block, byte[] val); } }