#pragma once
#include <vector>
#include <cstdint>
#include "rsa.h"

namespace netplus {

class rsa_pss_sha256 {
public:
    // Signiert "message" mit RSA-PSS-SHA256 und verwendet rsa private key (d,n)
    static std::vector<uint8_t> sign(netplus::rsa& key,
                                    const std::vector<uint8_t>& message);

private:
    static std::vector<uint8_t> sha256(const std::vector<uint8_t>& in);
    static std::vector<uint8_t> mgf1_sha256(const std::vector<uint8_t>& seed, size_t outLen);

    static std::vector<uint8_t> emsa_pss_encode(const std::vector<uint8_t>& mHash,
                                                size_t emBits);
};

} // namespace netplus

