C# Class Org.BouncyCastle.Crypto.Macs.Poly1305

Poly1305 message authentication code, designed by D. J. Bernstein.
Poly1305 computes a 128-bit (16 bytes) authenticator, using a 128 bit nonce and a 256 bit key consisting of a 128 bit key applied to an underlying cipher, and a 128 bit key (with 106 effective key bits) used in the authenticator. The polynomial calculation in this implementation is adapted from the public domain poly1305-donna-unrolled C implementation by Andrew M (@floodyberry).
Inheritance: IMac
ファイルを表示 Open project: gkardava/WinPass Class Usage Examples

Public Methods

Method Description
BlockUpdate ( byte input, int inOff, int len ) : void
DoFinal ( byte output, int outOff ) : int
GetMacSize ( ) : int
Init ( ICipherParameters parameters ) : void

Initialises the Poly1305 MAC.

Poly1305 ( ) : System
Poly1305 ( IBlockCipher cipher ) : System
Reset ( ) : void
Update ( byte input ) : void

Private Methods

Method Description
ProcessBlock ( ) : void
SetKey ( byte key, byte nonce ) : void
mul32x32_64 ( uint i1, uint i2 ) : ulong

Method Details

BlockUpdate() public method

public BlockUpdate ( byte input, int inOff, int len ) : void
input byte
inOff int
len int
return void

DoFinal() public method

public DoFinal ( byte output, int outOff ) : int
output byte
outOff int
return int

GetMacSize() public method

public GetMacSize ( ) : int
return int

Init() public method

Initialises the Poly1305 MAC.
public Init ( ICipherParameters parameters ) : void
parameters ICipherParameters a {@link ParametersWithIV} containing a 128 bit nonce and a {@link KeyParameter} with /// a 256 bit key complying to the {@link Poly1305KeyGenerator Poly1305 key format}.
return void

Poly1305() public method

public Poly1305 ( ) : System
return System

Poly1305() public method

public Poly1305 ( IBlockCipher cipher ) : System
cipher IBlockCipher
return System

Reset() public method

public Reset ( ) : void
return void

Update() public method

public Update ( byte input ) : void
input byte
return void