Merge branch '364-add-mac-to-crypto-component' into 'master'

Add MAC function to crypto component



See merge request !295
This commit is contained in:
Torsten Grote
2016-08-26 13:34:56 +00:00
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