IPWorks Encrypt 2020 Android Edition

Questions / Feedback?

ComputeMACBlock Method

Computes the MAC value of specified data.

Syntax

public byte[] computeMACBlock(byte[] inputBuffer, boolean lastBlock);

Remarks

ComputeMACBlock allows input to the component to be specified in blocks. This method will return the MAC value only when the parameter LastBlock is True.

InputBuffer specifies the input data.

LastBlock specifies whether the block is the last block. If this is False the method will return an empty byte array.

To calculate the MAC value of data that is broken apart into multiple blocks make multiple calls to this method. For instance:

//Encode output in hex
poly1305.EncodeMAC = true; //hex output

//Pass any number of parts, of any size
poly1305.ComputeMACBlock(part1,false);
poly1305.ComputeMACBlock(part2,false);
poly1305.ComputeMACBlock(part3,false);

//Pass true for the last block
poly1305.ComputeMACBlock(lastPart,true);

//The MACValue property holds the MAC value
Console.WriteLine(poly1305.MACValue);

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Android Edition - Version 20.0 [Build 8161]