> For the complete documentation index, see [llms.txt](https://coherence.3vidence.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coherence.3vidence.com/vmac.md).

# VMAC

## MAC

In order to understand *hex* and *type* parameters read [Hash](https://github.com/liesware/coherence/wiki/Hash)

### VMAC

[spec](http://www.fastcrypto.org/vmac/)

Description: Message authentication code based on universal hash.

Uses: High performance on 64-bit machines

## How to ???

```python
import requests
import json
import os,binascii

def sending(message):
    url = 'http://127.0.0.1:6613/'
    response = requests.post(url, data=message)
    print response.content
    return response.content

data_js='{"version":1,"algorithm":"VMAC","type":"string","plaintext":"Hello world!",\
"hex":0,"key":"0123456789ABCDEF0123456789ABCDEF", "iv":"0123456789ABCDEF0123456789ABCDEF",\
"family":"aes"}'
sending(data_js)
```

Calculate VMAC-AES to string *"Hello world!"* with the key and iv given.

On *data\_js\["family"]* can be one of *{"aes", "rc6", "mars","serpent","twofish', "cast256"}*

Json to HMAC string

```javascript
{"version":1,"algorithm":"VMAC","type":"string","plaintext":"your string","hex":BOOL,
"key":"Hex stringsize=32-64","iv":"Hex stringsize=32","family":"block flavor"}
```

Json to HMAC file

```javascript
{"version":1,"algorithm":"CMAC","type":"file","file":"your file",
"key":"Hex stringsize=32-64","iv":"Hex stringsize=32","family":"block flavor"}
```
