# Poly1305

[Message Authentication Codes video](https://www.youtube.com/watch?v=DiLPn_ldAAQ\&index=22\&list=PL6N5qY2nvvJE8X75VkXglSrVhLv1tVcfy)

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

## Poly1305

[spec](https://tools.ietf.org/html/rfc7539)

Description: Message authentication code based on block cipher.

Uses: Performance is important

Key size: 256 bits

Nonce size: 128 bits

## 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":"POLY1305","type":"string","plaintext":"Hello world!","hex":0,"key":"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF","nonce":"0123456789ABCDEF0123456789ABCDEF"}'
sending(data_js)
```

In this example we generate POLY1305 to hex string *Hello world!* with the key and nonce given.

Json to poly1035 string

```javascript
{"version":1,"algorithm":"POLY1305","type":"string","plaintext":"your string ",
"hex": BOOL,"key":"Hex string size=32,48,64","nonce":"Hex string size=32"}
```

Json to poly1035 file

```javascript
{"version":1,"algorithm":"POLY1305","type":"file","file":"your file","hex": BOOL,
"key":"Hex stringsize=32,48,64","nonce":"Hex string size=32"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coherence.3vidence.com/poly1305.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
