Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
Classes | Namespaces | Functions | Variables
crypto0.cpp File Reference
#include <cipherpack/cipherpack.hpp>
#include <jau/cpuid.hpp>
#include <jau/os/os_support.hpp>
#include <jau/debug.hpp>
Include dependency graph for crypto0.cpp:

Go to the source code of this file.

Classes

class  Botan::CPUID
 

Namespaces

namespace  Botan
 

Functions

static void cp_print_hash_provider (const std::string &algo) noexcept
 
static std::string cp_query_hash_provider (const std::string &algo) noexcept
 
static cipherpack::secure_vector< uint8_t > jau_PKCS8_decode (Botan::DataSource &source, const std::string &passphrase, Botan::AlgorithmIdentifier &pk_alg_id, bool is_encrypted)
 PEM decode and/or decrypt a private key. More...
 
static cipherpack::secure_vector< uint8_t > jau_PKCS8_extract (Botan::DataSource &source, Botan::AlgorithmIdentifier &pbe_alg_id)
 Get info from an EncryptedPrivateKeyInfo. More...
 

Variables

static constexpr const size_t ChaCha_Nonce_BitSize = 96
 Symmetric Encryption nonce size in bytes. More...
 
static const std::string default_hash_algo_ = "BLAKE2b(512)"
 
static const std::string default_pk_enc_hash_algo = "SHA-256"
 
static const std::string default_pk_enc_padding_algo = "OAEP"
 
static const std::string default_pk_fingerprt_hash_algo = "SHA-256"
 
static const std::string default_pk_sign_algo = "EMSA1(SHA-256)"
 
static const std::string default_pk_type = "RSA"
 
static const std::string default_sym_enc_mac_algo = "ChaCha20Poly1305"
 

Function Documentation

◆ cp_query_hash_provider()

static std::string cp_query_hash_provider ( const std::string &  algo)
staticnoexcept

Definition at line 56 of file crypto0.cpp.

Here is the caller graph for this function:

◆ cp_print_hash_provider()

static void cp_print_hash_provider ( const std::string &  algo)
staticnoexcept

Definition at line 64 of file crypto0.cpp.

Here is the caller graph for this function:

◆ jau_PKCS8_extract()

static cipherpack::secure_vector< uint8_t > jau_PKCS8_extract ( Botan::DataSource &  source,
Botan::AlgorithmIdentifier &  pbe_alg_id 
)
static

Get info from an EncryptedPrivateKeyInfo.

Copied from Botan, allowing to only pass passphrase by const reference for later secure erasure not leaving a copy in memory.

Definition at line 202 of file crypto0.cpp.

Here is the caller graph for this function:

◆ jau_PKCS8_decode()

static cipherpack::secure_vector< uint8_t > jau_PKCS8_decode ( Botan::DataSource &  source,
const std::string &  passphrase,
Botan::AlgorithmIdentifier &  pk_alg_id,
bool  is_encrypted 
)
static

PEM decode and/or decrypt a private key.

Copied from Botan, allowing to only pass passphrase by const reference for later secure erasure not leaving a copy in memory.

Definition at line 237 of file crypto0.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ default_pk_type

const std::string default_pk_type = "RSA"
static

Definition at line 100 of file crypto0.cpp.

◆ default_pk_fingerprt_hash_algo

const std::string default_pk_fingerprt_hash_algo = "SHA-256"
static

Definition at line 101 of file crypto0.cpp.

◆ default_pk_enc_padding_algo

const std::string default_pk_enc_padding_algo = "OAEP"
static

Definition at line 102 of file crypto0.cpp.

◆ default_pk_enc_hash_algo

const std::string default_pk_enc_hash_algo = "SHA-256"
static

Definition at line 103 of file crypto0.cpp.

◆ default_pk_sign_algo

const std::string default_pk_sign_algo = "EMSA1(SHA-256)"
static

Definition at line 104 of file crypto0.cpp.

◆ default_sym_enc_mac_algo

const std::string default_sym_enc_mac_algo = "ChaCha20Poly1305"
static

Definition at line 106 of file crypto0.cpp.

◆ default_hash_algo_

const std::string default_hash_algo_ = "BLAKE2b(512)"
static

Definition at line 108 of file crypto0.cpp.

◆ ChaCha_Nonce_BitSize

constexpr const size_t ChaCha_Nonce_BitSize = 96
staticconstexpr

Symmetric Encryption nonce size in bytes.

We only process one message per 'encrypted_key', hence medium nonce size of 96 bit.

ChaCha Nonce Sizes are usually: 64-bit classic, 96-bit IETF, 192-bit big

Definition at line 121 of file crypto0.cpp.