proxygen
AESOCB128.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
12 #include <openssl/evp.h>
13 #include <stdexcept>
14 
15 namespace fizz {
16 
17 struct AESOCB128 {
18  static const EVP_CIPHER* Cipher() {
19 #if FOLLY_OPENSSL_IS_110 && !defined(OPENSSL_NO_OCB)
20  return EVP_aes_128_ocb();
21 #else
22  throw std::runtime_error(
23  "aes-ocb support requires OpenSSL 1.1.0 with ocb enabled");
24 #endif
25  }
26 
27  static const size_t kKeyLength{16};
28  static const size_t kIVLength{12};
29  static const size_t kTagLength{16};
30  static const bool kOperatesInBlocks{true};
31  static const bool kRequiresPresetTagLen{true};
32 };
33 
34 } // namespace fizz
static const bool kRequiresPresetTagLen
Definition: AESOCB128.h:31
static const size_t kIVLength
Definition: AESOCB128.h:28
static const EVP_CIPHER * Cipher()
Definition: AESOCB128.h:18
Definition: Actions.h:16
static const bool kOperatesInBlocks
Definition: AESOCB128.h:30
static const size_t kKeyLength
Definition: AESOCB128.h:27
static const size_t kTagLength
Definition: AESOCB128.h:29