Package com.google.crypto.tink.mac
Interface ChunkedMacVerification
-
public interface ChunkedMacVerificationAn interface representing a verification of the Streaming MAC.WARNING: Implementations of this interface are not thread-safe, so the caller must ensure thread-safety if accessing objects implementing this interface concurrently.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidupdate(java.nio.ByteBuffer data)Processes the next chunk of input, represented byByteBuffer data.voidverifyMac()Verifies that the provided data matches the tag.
-
-
-
Method Detail
-
update
void update(java.nio.ByteBuffer data) throws java.security.GeneralSecurityExceptionProcesses the next chunk of input, represented byByteBuffer data. In particular, reads thedata.remaining()number of bytes from the provided buffer, starting at the byte with positiondata.position().Updates the inner state of the computation. Requires exclusive access.
NOTE: arbitrary slicing of data is permitted, i.e. a series of
update()'s with inputs"ab","cd", and"ef"produces the same result as a series of inputs"abc","def".- Throws:
java.lang.IllegalStateException- if called after verifyMac()java.security.GeneralSecurityException- when something went wrong with the update
-
verifyMac
void verifyMac() throws java.security.GeneralSecurityExceptionVerifies that the provided data matches the tag. After this method has been called, the object can no longer be used.Requires exclusive access.
- Throws:
java.lang.IllegalStateException- when called more than oncejava.security.GeneralSecurityException- when the tag does not match the data
-
-