Botan 3.4.0
Crypto and TLS for C&
rfc4880.h
Go to the documentation of this file.
1/*
2* (C) 2021 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_RFC4880_H_
8#define BOTAN_RFC4880_H_
9
10#include <botan/types.h>
11
12namespace Botan {
13
14/*
15Helpers for encoding PGP S2K values (see RFC 4880)
16*/
17
18/**
19* RFC 4880 encodes the iteration count to a single-byte value
20*/
21uint8_t BOTAN_PUBLIC_API(2, 8) RFC4880_encode_count(size_t iterations);
22
23/**
24* Decode the iteration count from RFC 4880 encoding
25*/
26size_t BOTAN_PUBLIC_API(2, 8) RFC4880_decode_count(uint8_t encoded_iter);
27
28/**
29* Round an arbitrary iteration count to next largest iteration count
30* supported by RFC4880 encoding.
31*/
32inline size_t RFC4880_round_iterations(size_t iterations) {
34}
35
36} // namespace Botan
37
38#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
uint8_t RFC4880_encode_count(size_t desired_iterations)
Definition rfc4880.cpp:47
size_t RFC4880_decode_count(uint8_t iter)
Definition rfc4880.cpp:61
size_t RFC4880_round_iterations(size_t iterations)
Definition rfc4880.h:32