Skip to content

Commit

Permalink
src: Recover some more code of 4a1013a
Browse files Browse the repository at this point in the history
  • Loading branch information
xdustinface committed Jul 2, 2021
1 parent ea0b8cb commit 7615e4f
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 66 deletions.
8 changes: 0 additions & 8 deletions src/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <algorithm>
#include <cstring>
#include <set>
#include <string>

#include "bls.hpp"

#if BLSALLOC_SODIUM
Expand All @@ -25,9 +20,6 @@

namespace bls {

const char BLS::GROUP_ORDER[] =
"73EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001";

bool BLSInitResult = BLS::Init();

Util::SecureAllocCallback Util::secureAllocCallback;
Expand Down
18 changes: 0 additions & 18 deletions src/bls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,13 @@
#ifndef SRC_BLS_HPP_
#define SRC_BLS_HPP_

#include <vector>
#include <map>
#include <string>
#include <stdexcept>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "privatekey.hpp"
#include "util.hpp"
#include "schemes.hpp"
#include "elements.hpp"
#include "hkdf.hpp"
#include "hdkeys.hpp"

extern "C" {
#include "relic.h"
}
#include "relic_test.h"

namespace bls {

/*
Expand All @@ -46,8 +30,6 @@ namespace bls {
*/
class BLS {
public:
// Order of g1, g2, and gt. Private keys are in {0, GROUP_ORDER}.
static const char GROUP_ORDER[];
static const size_t MESSAGE_HASH_LEN = 32;

// Initializes the BLS library (called automatically)
Expand Down
7 changes: 0 additions & 7 deletions src/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <algorithm>
#include <cstring>
#include <string>

#include "bls.hpp"
#include "elements.hpp"
#include "privatekey.hpp"
#include "util.hpp"

namespace bls {


G1Element G1Element::FromBytes(const Bytes& bytes)
{
if (bytes.size() != SIZE) {
Expand Down Expand Up @@ -145,7 +139,6 @@ uint32_t G1Element::GetFingerprint() const
return Util::FourBytesToInt(hash);
}


std::vector<uint8_t> G1Element::Serialize() const {
uint8_t buffer[G1Element::SIZE + 1];
g1_write_bin(buffer, G1Element::SIZE + 1, p, 1);
Expand Down
1 change: 0 additions & 1 deletion src/elements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class G2Element {
friend G2Element operator*(const G2Element &a, const bn_t &k);
friend G2Element operator*(const bn_t &k, const G2Element &a);


private:
g2_t q;
};
Expand Down
9 changes: 0 additions & 9 deletions src/privatekey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <algorithm>
#include <cassert>
#include <cstring>
#include <string>

#include "bls.hpp"
#include "elements.hpp"
#include "hkdf.hpp"
#include "privatekey.hpp"
#include "util.hpp"

namespace bls {

Expand Down
8 changes: 1 addition & 7 deletions src/privatekey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@ class PrivateKey {
size_t len,
const uint8_t *dst,
size_t dst_len) const;

G2Element SignG2Prehashed(
const uint8_t *messageHash,
const uint8_t *dst,
size_t dst_len) const;



private:
// Don't allow public construction, force static methods
PrivateKey();
Expand Down
2 changes: 0 additions & 2 deletions src/schemes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
// limitations under the License.

#include <algorithm>
#include <cstring>
#include <set>
#include <string>

#include "bls.hpp"
#include "elements.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/schemes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@

#include "elements.hpp"
#include "privatekey.hpp"
#include "util.hpp"

using std::vector;

// These are all MPL schemes
namespace bls {

class Bytes;

class CoreMPL {

public:
Expand Down
14 changes: 1 addition & 13 deletions src/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,10 @@
#ifndef SRC_BLSUTIL_HPP_
#define SRC_BLSUTIL_HPP_

#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <cstdlib>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

extern "C" {
#include "relic.h"
}
#include "relic_test.h"
#include <vector>

namespace bls {

Expand Down

0 comments on commit 7615e4f

Please sign in to comment.