YPC  0.2.0
crypto_pack.h
1 #pragma once
2 #include "ypc/corecommon/crypto/aes_gcm_traits.h"
3 #include "ypc/corecommon/crypto/interface/aes_impl.h"
4 #include "ypc/corecommon/crypto/interface/ecc_impl.h"
5 #include "ypc/corecommon/crypto/interface/ecdh_impl.h"
6 #include "ypc/corecommon/crypto/interface/hash_impl.h"
7 #include "ypc/corecommon/crypto/interface/sign_impl.h"
8 
9 namespace ypc {
10 namespace crypto {
11 
12 template <typename EC, typename Hash, typename AES, typename ECDH,
13  bool use_gcm = aes_gcm_traits<AES>::value>
14 struct crypto_pack {};
15 
16 template <typename EC, typename Hash, typename AES, typename ECDH>
17 struct crypto_pack<EC, Hash, AES, ECDH, true>
18  : public internal::ecc_impl<EC>,
19  public internal::hash_impl<Hash>,
20  public internal::sign_impl<Hash, EC>,
21  public internal::ecdh_impl<ECDH>,
22  public internal::aes_gcm_impl<EC, AES, ECDH> {
23  typedef EC ecc_t;
24  typedef Hash hash_t;
25  typedef AES aes_t;
26  typedef ECDH ecdh_t;
27 };
28 
29 template <typename EC, typename Hash, typename AES, typename ECDH>
30 struct crypto_pack<EC, Hash, AES, ECDH, false>
31  : public internal::ecc_impl<EC>,
32  public internal::hash_impl<Hash>,
33  public internal::sign_impl<Hash, EC>,
34  public internal::ecdh_impl<ECDH>,
35  public internal::aes_impl<EC, AES, ECDH> {
36  typedef EC ecc_t;
37  typedef Hash hash_t;
38  typedef AES aes_t;
39  typedef ECDH ecdh_t;
40 };
41 
42 } // namespace crypto
43 } // namespace ypc
ypc::crypto::internal::aes_impl
Definition: aes_impl.h:122
ypc::crypto::internal::ecdh_impl
Definition: ecdh_impl.h:7
ypc::crypto::internal::hash_impl
Definition: hash_impl.h:8
ypc::crypto::internal::aes_gcm_impl
Definition: aes_impl.h:8
ypc::crypto::internal::sign_impl
Definition: sign_impl.h:7
ypc::crypto::internal::ecc_impl
Definition: ecc_impl.h:7
ypc::crypto::crypto_pack
Definition: crypto_pack.h:14