Browse Source

style, file headers

cl-refactor
subtly 10 years ago
parent
commit
1f0a11401b
  1. 8
      libdevcrypto/EC.cpp
  2. 21
      libdevcrypto/EC.h
  3. 8
      libdevcrypto/ECIES.cpp
  4. 16
      libdevcrypto/ECIES.h
  5. 8
      libdevcrypto/SHA3MAC.cpp
  6. 8
      libdevcrypto/SHA3MAC.h

8
libdevcrypto/EC.cpp

@ -1,16 +1,16 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
@ -18,7 +18,7 @@
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
* Shared EC classes and functions.
*/
#pragma warning(push)

21
libdevcrypto/EC.h

@ -1,16 +1,16 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
@ -18,7 +18,7 @@
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
* Shared EC classes and functions.
*/
#pragma once
@ -56,23 +56,22 @@ inline CryptoPP::OID secp256k1()
{
return CryptoPP::ASN1::secp256k1();
}
class ECKeyPair
{
public:
static ECKeyPair create();
CryptoPP::DL_PublicKey_EC<CryptoPP::ECP> pub() { return m_pub; } // deprecate
CryptoPP::DL_PrivateKey_EC<CryptoPP::ECP> sec() { return m_sec; } // deprecate
/// deprecate
CryptoPP::DL_PublicKey_EC<CryptoPP::ECP> pub() { return m_pub; }
/// deprecate
CryptoPP::DL_PrivateKey_EC<CryptoPP::ECP> sec() { return m_sec; }
private:
ECKeyPair() {}
CryptoPP::DL_PublicKey_EC<CryptoPP::ECP> m_pub;
CryptoPP::DL_PrivateKey_EC<CryptoPP::ECP> m_sec;
};
//class ECDHE;
//bytes ECSign(KeyPair, bytesConstRef);
//bool ECVerify(Public, bytesConstRef);
}
}

8
libdevcrypto/ECIES.cpp

@ -1,16 +1,16 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
@ -18,7 +18,7 @@
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
* ECIES Encrypt/Decrypt
*/
#include "EC.h"

16
libdevcrypto/ECIES.h

@ -1,16 +1,16 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
@ -18,7 +18,7 @@
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
* ECIES Encrypt/Decrypt
*/
#pragma once
@ -52,10 +52,10 @@ class ECIESEncryptor
{
public:
ECIESEncryptor(ECKeyPair* _k);
/// Encrypt _message. (object will be resized and replaced with cipher)
void encrypt(bytes& _message);
private:
CryptoPP::ECIES<CryptoPP::ECP>::Encryptor m_encryptor;
};
@ -67,10 +67,10 @@ class ECIESDecryptor
{
public:
ECIESDecryptor(ECKeyPair* _k);
/// Decrypt cipher to plain.
bytes decrypt(bytesConstRef& _c);
private:
CryptoPP::ECIES<CryptoPP::ECP>::Decryptor m_decryptor;
};

8
libdevcrypto/SHA3MAC.cpp

@ -1,22 +1,24 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file SHA3MAC.cpp
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* SHA3 MAC
*/
#pragma GCC diagnostic ignored "-Wunused-function"

8
libdevcrypto/SHA3MAC.h

@ -1,16 +1,16 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
@ -18,7 +18,7 @@
* @author Alex Leverington <nessence@gmail.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
* SHA3 MAC
*/
#pragma once

Loading…
Cancel
Save