code: byte[] s2v(byte[] macKey, byte[] plaintext, byte[]... associatedData) {
  		// Maximum permitted AD length is the block size in bits - 2
  		if (associatedData.length > 126) {
  			// SIV mode cannot be used safely with this many AD fields
  			throw new IllegalArgumentException("too many Associated Data fields");
  		}
  
  		final CipherParameters params = new KeyParameter(macKey);
  		final CMac mac = new CMac(threadLocalCipher.get());
  		mac.init(params);
  
  		byte[] d = mac(mac, BYTES_ZERO);
  
  		for (byte[] s : associatedData) {
  			d = xor(dbl(d), mac(mac, s));
  		}
  
  		final byte[] t;
  		if (plaintext.length >= 16) {
  			t = xorend(plaintext, d);
  		} else {
  			t = xor(dbl(d), pad(plaintext));
  		}
  
  		return mac(mac, t);
  	}
docs: Visible for testing, throws IllegalArgumentException if key is not accepted by CMac#init(CipherParameters)