Botan 3.6.1
Crypto and TLS for C&
poly_dbl.h
Go to the documentation of this file.
1/*
2* (C) 2017 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_POLY_DBL_H_
8#define BOTAN_POLY_DBL_H_
9
10#include <botan/types.h>
11
12namespace Botan {
13
14/**
15* Polynomial doubling in GF(2^n)
16*/
17void BOTAN_TEST_API poly_double_n(uint8_t out[], const uint8_t in[], size_t n);
18
19/**
20* Returns true iff poly_double_n is implemented for this size.
21*/
22inline bool poly_double_supported_size(size_t n) {
23 return (n == 8 || n == 16 || n == 24 || n == 32 || n == 64 || n == 128);
24}
25
26inline void poly_double_n(uint8_t buf[], size_t n) {
27 return poly_double_n(buf, buf, n);
28}
29
30/*
31* Little endian convention - used for XTS
32*/
33void BOTAN_TEST_API poly_double_n_le(uint8_t out[], const uint8_t in[], size_t n);
34
35/*
36* Tweak block update step for XTS
37*/
38void xts_update_tweak_block(uint8_t tweak[], size_t BS, size_t n);
39
40} // namespace Botan
41
42#endif
#define BOTAN_TEST_API
Definition compiler.h:51
void xts_update_tweak_block(uint8_t tweak[], size_t BS, size_t blocks_in_tweak)
Definition poly_dbl.cpp:119
void poly_double_n_le(uint8_t out[], const uint8_t in[], size_t n)
Definition poly_dbl.cpp:100
void poly_double_n(uint8_t out[], const uint8_t in[], size_t n)
Definition poly_dbl.cpp:81
bool poly_double_supported_size(size_t n)
Definition poly_dbl.h:22