NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
block-cipher.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_CXX_SECURITY_TRANSFORM_BLOCK_CIPHER_HPP
23 #define NDN_CXX_SECURITY_TRANSFORM_BLOCK_CIPHER_HPP
24 
25 #include "transform-base.hpp"
26 #include "../security-common.hpp"
27 
28 namespace ndn {
29 namespace security {
30 namespace transform {
31 
38 class BlockCipher : public Transform
39 {
40 public:
52  const uint8_t* key, size_t keyLen,
53  const uint8_t* iv, size_t ivLen);
54 
55 private:
59  virtual void
60  preTransform() final;
61 
67  virtual size_t
68  convert(const uint8_t* data, size_t dataLen) final;
69 
73  virtual void
74  finalize() final;
75 
79  void
80  fillOutputBuffer();
81 
85  bool
86  isConverterEmpty() const;
87 
88 private:
89 
90  void
91  initializeAesCbc(const uint8_t* key, size_t keyLen,
92  const uint8_t* iv, size_t ivLen,
93  CipherOperator op);
94 
95 private:
96  class Impl;
97  unique_ptr<Impl> m_impl;
98 };
99 
100 unique_ptr<Transform>
102  const uint8_t* key, size_t keyLen,
103  const uint8_t* iv, size_t ivLen);
104 
105 } // namespace transform
106 } // namespace security
107 } // namespace ndn
108 
109 #endif // NDN_CXX_SECURITY_TRANSFORM_BLOCK_CIPHER_HPP
There are three types of module in a transformation chain: Source, Transform, and Sink...
Copyright (c) 2011-2015 Regents of the University of California.
BlockCipherAlgorithm
unique_ptr< Transform > blockCipher(BlockCipherAlgorithm algo, CipherOperator op, const uint8_t *key, size_t keyLen, const uint8_t *iv, size_t ivLen)
Abstraction of an intermediate transformation module.
The module to encrypt data using block cipher.
BlockCipher(BlockCipherAlgorithm algo, CipherOperator op, const uint8_t *key, size_t keyLen, const uint8_t *iv, size_t ivLen)
Create a block cipher.