Added MAC function to crypto component.

This commit is contained in:
akwizgran
2016-08-26 10:06:24 +01:00
parent 00240bfa57
commit 30f2c192c6
3 changed files with 88 additions and 0 deletions

View File

@@ -143,6 +143,13 @@ public interface CryptoComponent {
*/
byte[] hash(byte[]... inputs);
/**
* Returns a message authentication code with the given key over the
* given inputs. The inputs are unambiguously combined by prefixing each
* input with its length.
*/
byte[] mac(SecretKey macKey, byte[]... inputs);
/**
* Encrypts and authenticates the given plaintext so it can be written to
* storage. The encryption and authentication keys are derived from the