libssh 0.12.0
The SSH library
Loading...
Searching...
No Matches
chacha20-poly1305-common.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2020 Red Hat, Inc.
5 *
6 * Author: Jakub Jelen <jjelen@redhat.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23/*
24 * chacha20-poly1305.h file
25 * This file includes definitions needed for Chacha20-poly1305 AEAD cipher
26 * using different crypto backends.
27 */
28
29#ifndef CHACHA20_POLY1305_H
30#define CHACHA20_POLY1305_H
31
32#include <stdint.h>
33
34#define CHACHA20_BLOCKSIZE 64
35#define CHACHA20_KEYLEN 32
36
37#define POLY1305_TAGLEN 16
38/* size of the keys k1 and k2 as defined in specs */
39#define POLY1305_KEYLEN 32
40
41#ifdef _MSC_VER
42#pragma pack(push, 1)
43#endif
44struct ssh_packet_header {
45 uint32_t length;
46 uint8_t payload[];
47}
48#if defined(__GNUC__)
49__attribute__ ((packed))
50#endif
51#ifdef _MSC_VER
52#pragma pack(pop)
53#endif
54;
55
56#endif /* CHACHA20_POLY1305_H */