1#ifndef BKCRACK_KEYS_HPP
2#define BKCRACK_KEYS_HPP
5#include "KeystreamTab.hpp"
16 Keys(std::uint32_t x, std::uint32_t y, std::uint32_t z);
19 explicit Keys(
const std::string& password);
30 void update(
const std::vector<std::uint8_t>& ciphertext, std::size_t current, std::size_t target);
49 void updateBackward(
const std::vector<std::uint8_t>& ciphertext, std::size_t current, std::size_t target);
52 auto getX() const -> std::uint32_t
58 auto getY() const -> std::uint32_t
64 auto getZ() const -> std::uint32_t
70 auto getK() const -> std::uint8_t
76 std::uint32_t x = 0x12345678;
77 std::uint32_t y = 0x23456789;
78 std::uint32_t z = 0x34567890;
static auto crc32inv(std::uint32_t crc, std::uint8_t b) -> std::uint32_t
Definition Crc32Tab.hpp:17
static auto crc32(std::uint32_t pval, std::uint8_t b) -> std::uint32_t
Definition Crc32Tab.hpp:11
auto getK() const -> std::uint8_t
Definition Keys.hpp:70
void updateBackwardPlaintext(std::uint8_t p)
Update the state backward with a plaintext byte.
Definition Keys.hpp:41
auto getZ() const -> std::uint32_t
Definition Keys.hpp:64
void update(const std::vector< std::uint8_t > &ciphertext, std::size_t current, std::size_t target)
Update the state forward to a target offset.
Keys(const std::string &password)
Construct keys associated to the given password.
auto getX() const -> std::uint32_t
Definition Keys.hpp:52
void updateBackward(std::uint8_t c)
Update the state backward with a ciphertext byte.
Definition Keys.hpp:33
void update(std::uint8_t p)
Update the state with a plaintext byte.
Definition Keys.hpp:22
auto getY() const -> std::uint32_t
Definition Keys.hpp:58
Keys(std::uint32_t x, std::uint32_t y, std::uint32_t z)
Construct keys from given components.
void updateBackward(const std::vector< std::uint8_t > &ciphertext, std::size_t current, std::size_t target)
Update the state backward to a target offset.
Keys()=default
Construct default state.
static auto getByte(std::uint32_t zi) -> std::uint8_t
Definition KeystreamTab.hpp:14
static constexpr std::uint32_t mult
Multiplicative constant used in traditional PKWARE encryption.
Definition MultTab.hpp:25
static constexpr std::uint32_t multInv
Multiplicative inverse of mult modulo 2^32.
Definition MultTab.hpp:28
constexpr auto lsb(std::uint32_t x) -> std::uint8_t
Definition types.hpp:24
constexpr auto msb(std::uint32_t x) -> std::uint8_t
Definition types.hpp:30