Skip to content

Commit

Permalink
Create crypto.h
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 6, 2024
1 parent ef94de3 commit 764ce35
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions blockchain_integration/pi_network/dapi/crypto/hash_based/crypto.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef CRYPTO_H
#define CRYPTO_H

#include <iostream>
#include <vector>
#include <NTL/ZZ.h>
#include <NTL/mat_ZZ.h>

class Crypto {
public:
Crypto();
~Crypto();

// Hash functions
std::vector<NTL::ZZ> sha256(const std::vector<NTL::ZZ>& input);
std::vector<NTL::ZZ> keccak256(const std::vector<NTL::ZZ>& input);

// Digital signatures
std::vector<NTL::ZZ> sign(const std::vector<NTL::ZZ>& message, const NTL::ZZ& privateKey);
bool verify(const std::vector<NTL::ZZ>& message, const std::vector<NTL::ZZ>& signature, const NTL::ZZ& publicKey);

private:
NTL::ZZ privateKey_;
NTL::ZZ publicKey_;
};

#endif // CRYPTO_H

0 comments on commit 764ce35

Please sign in to comment.