Top Description Methods
org.bouncycastle.tls.crypto.impl

public Interface TlsSuiteMac

Known Direct Implementers
org.bouncycastle.tls.crypto.impl.TlsSuiteHMac

Base interface for a generic TLS MAC implementation for use with a bulk cipher.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

A new byte array containing the MAC value.
calculateMac
(long
The sequence number of the record.
seqNo
,
short
The content type of the message.
type
,
byte[] connectionID, byte[]
A byte array containing the message.
message
,
int
The number of bytes to skip, before the message starts.
offset
,
int
The length of the message.
length
)

Calculate the MAC for some given data.

public byte[]

Returns:

A new byte array containing the MAC value.
calculateMacConstantTime
(long
The sequence number of the record.
seqNo
,
short
The content type of the message.
type
,
byte[] connectionID, byte[]
A byte array containing the message.
message
,
int
The number of bytes to skip, before the message starts.
offset
,
int
The length of the message.
length
,
int
The expected length of the full message.
expectedLength
,
byte[]
Random data for padding out the MAC calculation if required.
randomData
)

Constant time calculation of the MAC for some given data with a given expected length.

public int

Returns:

The output length of this MAC.
getSize
()

Return the output length (in bytes) of this MAC.

Method Detail

calculateMacback to summary
public byte[] calculateMac(long seqNo, short type, byte[] connectionID, byte[] message, int offset, int length)

Calculate the MAC for some given data.

Parameters
seqNo:long

The sequence number of the record.

type:short

The content type of the message.

message:byte[]

A byte array containing the message.

offset:int

The number of bytes to skip, before the message starts.

length:int

The length of the message.

Returns:byte[]

A new byte array containing the MAC value.

calculateMacConstantTimeback to summary
public byte[] calculateMacConstantTime(long seqNo, short type, byte[] connectionID, byte[] message, int offset, int length, int expectedLength, byte[] randomData)

Constant time calculation of the MAC for some given data with a given expected length.

Parameters
seqNo:long

The sequence number of the record.

type:short

The content type of the message.

message:byte[]

A byte array containing the message.

offset:int

The number of bytes to skip, before the message starts.

length:int

The length of the message.

expectedLength:int

The expected length of the full message.

randomData:byte[]

Random data for padding out the MAC calculation if required.

Returns:byte[]

A new byte array containing the MAC value.

getSizeback to summary
public int getSize()

Return the output length (in bytes) of this MAC.

Returns:int

The output length of this MAC.