Class ChaCha20Poly1305.Poly1305
java.lang.Object
com.sshtools.common.ssh.components.jce.ChaCha20Poly1305.Poly1305
- Enclosing class:
- ChaCha20Poly1305
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).
- See Also:
-
Poly1305KeyGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionPoly1305()Constructs a Poly1305 MAC, where the key passed to init() will be used directly. -
Method Summary
-
Constructor Details
-
Poly1305
public Poly1305()Constructs a Poly1305 MAC, where the key passed to init() will be used directly.
-
-
Method Details
-
init
Initialises the Poly1305 MAC.- Parameters:
params- if used with a block cipher, then aParametersWithIVcontaining a 128 bit nonce and aKeyParameterwith a 256 bit key complying to thePoly1305 key format, otherwise just theKeyParameter.- Throws:
IllegalArgumentException
-
getAlgorithmName
-
getMacSize
public int getMacSize() -
update
- Throws:
IOExceptionIllegalStateException
-
update
- Throws:
IOExceptionIllegalStateException
-
doFinal
- Throws:
IOExceptionIllegalStateException
-
reset
public void reset()
-