Top Description Fields Constructors Methods
org.apache.sshd.common.mac

public Class Poly1305Mac

extends Object
implements Mac
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.mac.Mac, org.apache.sshd.common.mac.MacInformation, org.apache.sshd.common.AlgorithmNameProvider
Imports
java.nio.BufferOverflowException, java.security.InvalidKeyException, java.util.Arrays, org.apache.sshd.common.util.NumberUtils, org.apache.sshd.common.util.buffer.BufferUtils

Poly1305 one-time message authentication code. This implementation is derived from the public domain C library poly1305-donna.
See Also
The Poly1305-AES message-authentication code

Field Summary

Modifier and TypeField and Description
private static final int
private final byte[]
private int
private int
private int
private int
private int
private int
private long
private long
private long
private long
public static final int
private long
private long
private long
private long
private long
private long
private long
private long
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
doFinal(byte[] out, int offset)

Implements org.apache.sshd.common.mac.Mac.doFinal.

public String
public int
public int
public void
public static void
packIntLE(int value, byte[] dst, int off)

private void
processBlock(byte[] block, int offset, int length)

private void
public static int
unpackIntLE(byte[] buf, int off)

public void
update(byte[] in, int offset, int length)

Implements org.apache.sshd.common.mac.Mac.update.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BLOCK_SIZEback to summary
private static final int BLOCK_SIZE
currentBlockback to summary
private final byte[] currentBlock
currentBlockOffsetback to summary
private int currentBlockOffset
h0back to summary
private int h0
h1back to summary
private int h1
h2back to summary
private int h2
h3back to summary
private int h3
h4back to summary
private int h4
k0back to summary
private long k0
k1back to summary
private long k1
k2back to summary
private long k2
k3back to summary
private long k3
KEY_BYTESback to summary
public static final int KEY_BYTES
r0back to summary
private long r0
r1back to summary
private long r1
r2back to summary
private long r2
r3back to summary
private long r3
r4back to summary
private long r4
s1back to summary
private long s1
s2back to summary
private long s2
s3back to summary
private long s3
s4back to summary
private long s4

Constructor Detail

Poly1305Macback to summary
public Poly1305Mac()

Method Detail

doFinalback to summary
public void doFinal(byte[] out, int offset) throws Exception

Implements org.apache.sshd.common.mac.Mac.doFinal.

Annotations
@Override
getAlgorithmback to summary
public String getAlgorithm()

Implements org.apache.sshd.common.AlgorithmNameProvider.getAlgorithm.

Annotations
@Override
getBlockSizeback to summary
public int getBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getBlockSize.

MAC output block size in bytes - may be less than the default - e.g., MD5-96

Annotations
@Override
getDefaultBlockSizeback to summary
public int getDefaultBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

The "natural" MAC block size in bytes

Annotations
@Override
initback to summary
public void init(byte[] key) throws Exception

Implements org.apache.sshd.common.mac.Mac.init.

Annotations
@Override
packIntLEback to summary
public static void packIntLE(int value, byte[] dst, int off)
processBlockback to summary
private void processBlock(byte[] block, int offset, int length)
resetback to summary
private void reset()
unpackIntLEback to summary
public static int unpackIntLE(byte[] buf, int off)
updateback to summary
public void update(byte[] in, int offset, int length)

Implements org.apache.sshd.common.mac.Mac.update.

Annotations
@Override
updateUIntback to summary
public void updateUInt(long value)

Implements org.apache.sshd.common.mac.Mac.updateUInt.

Annotations
@Override