aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/chacha20-poly1305-common.h
blob: b2f0231b7292a7e9f20e7fcfbb324e66fb01a59f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * This file is part of the SSH Library
 *
 * Copyright (c) 2020 Red Hat, Inc.
 *
 * Author: Jakub Jelen <jjelen@redhat.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/*
 * chacha20-poly1305.h file
 * This file includes definitions needed for Chacha20-poly1305 AEAD cipher
 * using different crypto backends.
 */

#ifndef CHACHA20_POLY1305_H
#define CHACHA20_POLY1305_H

#define CHACHA20_BLOCKSIZE 64
#define CHACHA20_KEYLEN 32

#define POLY1305_TAGLEN 16
/* size of the keys k1 and k2 as defined in specs */
#define POLY1305_KEYLEN 32

#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct ssh_packet_header {
    uint32_t length;
    uint8_t payload[];
}
#if defined(__GNUC__)
__attribute__ ((packed))
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif
;

#endif /* CHACHA20_POLY1305_H */