Botan  1.11.10
Public Member Functions | List of all members
Botan::Bzip_Compression Class Reference

#include <bzip2.h>

Inheritance diagram for Botan::Bzip_Compression:
Botan::Stream_Compression Botan::Compressor_Transformation Botan::Transformation

Public Member Functions

 Bzip_Compression (size_t level=6)
 
void clear () override
 
size_t default_nonce_length () const override
 
void finish (secure_vector< byte > &buf, size_t offset=0) override
 
void flush (secure_vector< byte > &buf, size_t offset=0) override
 
size_t minimum_final_size () const override
 
std::string name () const override
 
size_t output_length (size_t) const override
 
virtual std::string provider () const
 
template<typename Alloc >
secure_vector< bytestart (const std::vector< byte, Alloc > &nonce)
 
secure_vector< bytestart (const byte nonce[], size_t nonce_len)
 
secure_vector< bytestart ()
 
template<typename Alloc >
secure_vector< bytestart_vec (const std::vector< byte, Alloc > &nonce)
 
void update (secure_vector< byte > &buf, size_t offset=0) override
 
size_t update_granularity () const override
 
bool valid_nonce_length (size_t nonce_len) const override
 

Detailed Description

Bzip Compression

Definition at line 19 of file bzip2.h.

Constructor & Destructor Documentation

Botan::Bzip_Compression::Bzip_Compression ( size_t  level = 6)
inline
Parameters
levelhow much effort to use on compressing (0 to 9); higher levels are slower but tend to give better compression

Definition at line 27 of file bzip2.h.

27 : m_level(level) {}

Member Function Documentation

void Botan::Stream_Compression::clear ( )
overridevirtualinherited

Implements Botan::Transformation.

Definition at line 72 of file compression.cpp.

Referenced by Botan::Stream_Compression::finish().

73  {
74  m_stream.reset();
75  }
size_t Botan::Compressor_Transformation::default_nonce_length ( ) const
inlineoverridevirtualinherited

Return the default size for a nonce

Implements Botan::Transformation.

Definition at line 22 of file compression.h.

22 { return 0; }
void Botan::Stream_Compression::finish ( secure_vector< byte > &  final_block,
size_t  offset = 0 
)
overridevirtualinherited

Complete processing of a message.

Parameters
final_blockin/out parameter which must be at least minimum_final_size() bytes, and will be set to any final output
offsetan offset into final_block to begin processing

Implements Botan::Transformation.

Definition at line 128 of file compression.cpp.

References Botan::Stream_Compression::clear().

129  {
130  process(buf, offset, m_stream->finish_flag());
131  clear();
132  }
void Botan::Stream_Compression::flush ( secure_vector< byte > &  buf,
size_t  offset = 0 
)
overridevirtualinherited

Reimplemented from Botan::Compressor_Transformation.

Definition at line 123 of file compression.cpp.

124  {
125  process(buf, offset, m_stream->flush_flag());
126  }
size_t Botan::Compressor_Transformation::minimum_final_size ( ) const
inlineoverridevirtualinherited
Returns
required minimium size to finalize() - may be any length larger than this.

Implements Botan::Transformation.

Definition at line 20 of file compression.h.

20 { return 0; }
std::string Botan::Bzip_Compression::name ( ) const
inlineoverridevirtual

Implements Botan::Transformation.

Definition at line 29 of file bzip2.h.

29 { return "Bzip_Compression"; }
size_t Botan::Compressor_Transformation::output_length ( size_t  input_length) const
inlineoverridevirtualinherited

Returns the size of the output if this transform is used to process a message with input_length bytes. Will throw if unable to give a precise answer.

Implements Botan::Transformation.

Definition at line 29 of file compression.h.

30  {
31  throw std::runtime_error(name() + " output length indeterminate");
32  }
virtual std::string name() const =0
virtual std::string Botan::Transformation::provider ( ) const
inlinevirtualinherited

Return some short name describing the provider of this tranformation. Useful in cases where multiple implementations are available (eg, different implementations of AES). Default "core" is used for the 'standard' implementation included in the library.

Definition at line 117 of file transform.h.

117 { return "core"; }
template<typename Alloc >
secure_vector<byte> Botan::Transformation::start ( const std::vector< byte, Alloc > &  nonce)
inlineinherited

Begin processing a message.

Parameters
noncethe per message nonce

Definition at line 31 of file transform.h.

32  {
33  return start(&nonce[0], nonce.size());
34  }
secure_vector< byte > start()
Definition: transform.h:60
secure_vector<byte> Botan::Transformation::start ( const byte  nonce[],
size_t  nonce_len 
)
inlineinherited

Begin processing a message.

Parameters
noncethe per message nonce
nonce_lenlength of nonce

Definition at line 52 of file transform.h.

53  {
54  return start_raw(nonce, nonce_len);
55  }
virtual secure_vector< byte > start_raw(const byte nonce[], size_t nonce_len)=0
secure_vector<byte> Botan::Transformation::start ( )
inlineinherited

Begin processing a message.

Definition at line 60 of file transform.h.

61  {
62  return start_raw(nullptr, 0);
63  }
virtual secure_vector< byte > start_raw(const byte nonce[], size_t nonce_len)=0
template<typename Alloc >
secure_vector<byte> Botan::Transformation::start_vec ( const std::vector< byte, Alloc > &  nonce)
inlineinherited

Begin processing a message.

Parameters
noncethe per message nonce

Definition at line 42 of file transform.h.

43  {
44  return start(&nonce[0], nonce.size());
45  }
secure_vector< byte > start()
Definition: transform.h:60
void Botan::Stream_Compression::update ( secure_vector< byte > &  blocks,
size_t  offset = 0 
)
overridevirtualinherited

Process some data. Input must be in size update_granularity() byte blocks.

Parameters
blocksin/out paramter which will possibly be resized
offsetan offset into blocks to begin processing

Implements Botan::Transformation.

Definition at line 118 of file compression.cpp.

119  {
120  process(buf, offset, m_stream->run_flag());
121  }
size_t Botan::Compressor_Transformation::update_granularity ( ) const
inlineoverridevirtualinherited
Returns
size of required blocks to update

Implements Botan::Transformation.

Definition at line 18 of file compression.h.

18 { return 1; }
bool Botan::Compressor_Transformation::valid_nonce_length ( size_t  nonce_len) const
inlineoverridevirtualinherited

Return true iff nonce_len is a valid length for the nonce

Implements Botan::Transformation.

Definition at line 24 of file compression.h.

25  { return nonce_len == 0; }

The documentation for this class was generated from the following files: