2 * Ceph - scalable distributed file system
4 * Copyright (C) 2016 Mirantis, Inc.
6 * Author: Adam Kupczyk <akupczyk@mirantis.com>
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.
15 #ifndef CRYPTO_ACCEL_H
16 #define CRYPTO_ACCEL_H
18 #include "include/Context.h"
21 typedef ceph::shared_ptr<CryptoAccel> CryptoAccelRef;
26 virtual ~CryptoAccel() {}
28 static const int AES_256_IVSIZE = 128/8;
29 static const int AES_256_KEYSIZE = 256/8;
30 virtual bool cbc_encrypt(unsigned char* out, const unsigned char* in, size_t size,
31 const unsigned char (&iv)[AES_256_IVSIZE],
32 const unsigned char (&key)[AES_256_KEYSIZE]) = 0;
33 virtual bool cbc_decrypt(unsigned char* out, const unsigned char* in, size_t size,
34 const unsigned char (&iv)[AES_256_IVSIZE],
35 const unsigned char (&key)[AES_256_KEYSIZE]) = 0;