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 ISAL_CRYPTO_PLUGIN_H
16 #define ISAL_CRYPTO_PLUGIN_H
17 // -----------------------------------------------------------------------------
18 #include "crypto/crypto_plugin.h"
19 #include "crypto/isa-l/isal_crypto_accel.h"
20 #include "arch/intel.h"
21 #include "arch/probe.h"
22 // -----------------------------------------------------------------------------
25 class ISALCryptoPlugin : public CryptoPlugin {
27 CryptoAccelRef cryptoaccel;
30 explicit ISALCryptoPlugin(CephContext* cct) : CryptoPlugin(cct)
34 virtual int factory(CryptoAccelRef *cs,
37 if (cryptoaccel == nullptr)
40 if (ceph_arch_intel_aesni && ceph_arch_intel_sse41) {
41 cryptoaccel = CryptoAccelRef(new ISALCryptoAccel);