summaryrefslogtreecommitdiffstats
path: root/src/librbd/crypto/Utils.h
blob: aed3d4767d9568eaf0fada7517a792338ff49d00 (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
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#ifndef CEPH_LIBRBD_CRYPTO_UTILS_H
#define CEPH_LIBRBD_CRYPTO_UTILS_H

#include "include/Context.h"
#include "librbd/crypto/CryptoInterface.h"

namespace librbd {

struct ImageCtx;

namespace crypto {
namespace util {

template <typename ImageCtxT = librbd::ImageCtx>
void set_crypto(ImageCtxT *image_ctx, ceph::ref_t<CryptoInterface> crypto);

int build_crypto(
        CephContext* cct, const unsigned char* key, uint32_t key_length,
        uint64_t block_size, uint64_t data_offset,
        ceph::ref_t<CryptoInterface>* result_crypto);

} // namespace util
} // namespace crypto
} // namespace librbd

#endif // CEPH_LIBRBD_CRYPTO_UTILS_H