aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
* crypto: fix error check in toECDSA (#15632)Felix Lange2017-12-122-0/+12
| | | | | | | | With this change, key, err := crypto.HexToECDSA("000000...") returns nil key and an error instead of a non-nil key with nil X and Y inside. Issue found by @guidovranken.
* crypto: add DecompressPubkey, VerifySignature (#15615)Felix Lange2017-12-066-15/+212
| | | | | | | We need those operations for p2p/enr. Also upgrade github.com/btcsuite/btcd/btcec to the latest version and improve BenchmarkSha3. The benchmark printed extra output that confused tools like benchstat and ignored N.
* crypto/bn256: fix generator on G1 (#15591)Matthew Di Ferrante2017-12-011-1/+1
| | | | | | | | | | | | | Generator in the current lib uses -2 as the y point when doing ScalarBaseMult, this makes it so that points/signatures generated from libs like py_ecc don't match/validate as pretty much all other libs (including libsnark) have (1, 2) as the standard generator. This does not affect consensus as the generator is never used in the VM, points are always explicitly defined and there is not ScalarBaseMult op - it only makes it so that doing "import github.com/ethereum/go-ethereum/crypto/bn256" doesn't generate bad points in userland tools.
* core/vm, crypto/bn256: fix bn256 use and pairing corner casePéter Szilágyi2017-08-172-7/+12
|
* crypto: fix megacheck warnings (#14917)Egon Elbre2017-08-086-870/+19
| | | | | | * crypto: fix megacheck warnings * crypto/ecies: remove ASN.1 support
* accounts/keystore, crypto: don't enforce key checks on existing keyfilesPéter Szilágyi2017-06-012-9/+21
|
* Merge pull request #14502 from karalabe/mobile-import-ecdsaFelix Lange2017-05-251-15/+12
|\ | | | | Enforce 256 bit keys on raw import, support raw mobile imports
| * accounts/keystore, crypto: enforce 256 bit keys on importPéter Szilágyi2017-05-231-15/+12
| |
* | crypto/bn256: fix go vet false positiveFelix Lange2017-05-244-19/+19
| | | | | | | | Also add the package to the license tool ignore list.
* | consensus, core/*, params: metropolis preparation refactorJeffrey Wilcke2017-05-1811-0/+2538
|/ | | | | | | | | | | | | | | | | | | | | | | | This commit is a preparation for the upcoming metropolis hardfork. It prepares the state, core and vm packages such that integration with metropolis becomes less of a hassle. * Difficulty calculation requires header instead of individual parameters * statedb.StartRecord renamed to statedb.Prepare and added Finalise method required by metropolis, which removes unwanted accounts from the state (i.e. selfdestruct) * State keeps record of destructed objects (in addition to dirty objects) * core/vm pre-compiles may now return errors * core/vm pre-compiles gas check now take the full byte slice as argument instead of just the size * core/vm now keeps several hard-fork instruction tables instead of a single instruction table and removes the need for hard-fork checks in the instructions * core/vm contains a empty restruction function which is added in preparation of metropolis write-only mode operations * Adds the bn256 curve * Adds and sets the metropolis chain config block parameters (2^64-1)
* all: update license informationFelix Lange2017-04-143-3/+3
|
* crypto, pow, vendor: hash optimizations, mmap ethashPéter Szilágyi2017-03-091-36/+0
|
* crypto, pow: add pure Go implementation of ethashPéter Szilágyi2017-03-093-2/+51
|
* all: unify big.Int zero checks, use common/math in more places (#3716)Felix Lange2017-02-285-60/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/math: optimize PaddedBigBytes, use it more name old time/op new time/op delta PaddedBigBytes-8 71.1ns ± 5% 46.1ns ± 1% -35.15% (p=0.000 n=20+19) name old alloc/op new alloc/op delta PaddedBigBytes-8 48.0B ± 0% 32.0B ± 0% -33.33% (p=0.000 n=20+20) * all: unify big.Int zero checks Various checks were in use. This commit replaces them all with Int.Sign, which is cheaper and less code. eg templates: func before(x *big.Int) bool { return x.BitLen() == 0 } func after(x *big.Int) bool { return x.Sign() == 0 } func before(x *big.Int) bool { return x.BitLen() > 0 } func after(x *big.Int) bool { return x.Sign() != 0 } func before(x *big.Int) int { return x.Cmp(common.Big0) } func after(x *big.Int) int { return x.Sign() } * common/math, crypto/secp256k1: make ReadBits public in package math
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: remove CurrencyToString Move denomination values to params instead. * common: delete dead code * common: move big integer operations to common/math This commit consolidates all big integer operations into common/math and adds tests and documentation. There should be no change in semantics for BigPow, BigMin, BigMax, S256, U256, Exp and their behaviour is now locked in by tests. The BigD, BytesToBig and Bytes2Big functions don't provide additional value, all uses are replaced by new(big.Int).SetBytes(). BigToBytes is now called PaddedBigBytes, its minimum output size parameter is now specified as the number of bytes instead of bits. The single use of this function is in the EVM's MSTORE instruction. Big and String2Big are replaced by ParseBig, which is slightly stricter. It previously accepted leading zeros for hexadecimal inputs but treated decimal inputs as octal if a leading zero digit was present. ParseUint64 is used in places where String2Big was used to decode a uint64. The new functions MustParseBig and MustParseUint64 are now used in many places where parsing errors were previously ignored. * common: delete unused big integer variables * accounts/abi: replace uses of BytesToBig with use of encoding/binary * common: remove BytesToBig * common: remove Bytes2Big * common: remove BigTrue * cmd/utils: add BigFlag and use it for error-checked integer flags While here, remove environment variable processing for DirectoryFlag because we don't use it. * core: add missing error checks in genesis block parser * common: remove String2Big * cmd/evm: use utils.BigFlag * common/math: check for 256 bit overflow in ParseBig This is supposed to prevent silent overflow/truncation of values in the genesis block JSON. Without this check, a genesis block that set a balance larger than 256 bits would lead to weird behaviour in the VM. * cmd/utils: fixup import
* crypto: add btcec fallback for sign/recover without cgo (#3680)Felix Lange2017-02-1810-188/+239
| | | | | | | | | | | * vendor: add github.com/btcsuite/btcd/btcec * crypto: add btcec fallback for sign/recover without cgo This commit adds a non-cgo fallback implementation of secp256k1 operations. * crypto, core/vm: remove wrappers for sha256, ripemd160
* crypto/secp256k1: sign with deterministic K (rfc6979) (#3561)Felix Lange2017-01-232-8/+22
|
* crypto/secp256k1: update to github.com/bitcoin-core/secp256k1 @ 9d560f9 (#3544)Felix Lange2017-01-1379-1998/+8229
| | | | | - Use defined constants instead of hard-coding their integer value. - Allocate secp256k1 structs on the C stack instead of converting []byte - Remove dead code
* all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-7/+2
| | | | | go get github.com/gordonklaus/ineffassign ineffassign .
* all: fix spelling errorsPéter Szilágyi2017-01-075-7/+7
|
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-072-4/+3
|
* all: gofmt -w -sFelix Lange2017-01-063-10/+10
|
* accounts, core, crypto, internal: use normalised V during signature handling ↵Péter Szilágyi2017-01-052-76/+29
| | | | | | | | | (#3455) To address increasing complexity in code that handles signatures, this PR discards all notion of "different" signature types at the library level. Both the crypto and accounts package is reduced to only be able to produce plain canonical secp256k1 signatures. This makes the crpyto APIs much cleaner, simpler and harder to abuse.
* internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)bas-vk2016-10-292-10/+62
| | | | | | | | | | | | | | | | | | | | This commit includes several API changes: - The behavior of eth_sign is changed. It now accepts an arbitrary message, prepends the well-known string \x19Ethereum Signed Message:\n<length of message> hashes the result using keccak256 and calculates the signature of the hash. This breaks backwards compatability! - personal_sign(hash, address [, password]) is added. It has the same semantics as eth_sign but also accepts a password. The private key used to sign the hash is temporarily unlocked in the scope of the request. - personal_recover(message, signature) is added and returns the address for the account that created a signature.
* crypto/sha3: update from golang.org/x/crypto/sha3 a 80b25ed4Felix Lange2016-10-026-3/+410
| | | | This pulls in the assembly implementation of keccakf1600 for amd64.
* all: fix go vet warningsFelix Lange2016-04-152-4/+4
|
* accounts, crypto: move keystore to package accountsFelix Lange2016-04-129-1160/+0
| | | | | | | | | | The account management API was originally implemented as a thin layer around crypto.KeyStore, on the grounds that several kinds of key stores would be implemented later on. It turns out that this won't happen so KeyStore is a superflous abstraction. In this commit crypto.KeyStore and everything related to it moves to package accounts and is unexported.
* tests: remove eth, node, accounts dependenciesFelix Lange2016-04-121-13/+0
| | | | Unlocking the accounts in the test doesn't help with anything.
* crypto: expose key encryption method, add ping-pong testPéter Szilágyi2016-02-242-18/+71
|
* crypto: code polish + ensure key file contents match with namePéter Szilágyi2016-02-241-5/+12
|
* crypto: expose key decryption method to parse a string direcltyPéter Szilágyi2016-02-242-36/+45
|
* crypto: Remove dead codeRicardo Catalinas Jiménez2016-02-222-11/+0
|
* crypto: Add backward compatible aliases for Sha3{,Hash}()Ricardo Catalinas Jiménez2016-02-221-0/+4
|
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-223-14/+14
| | | | As we aren't really using the standarized SHA-3
* crypto/sha3: Export Keccak-256 hash functionRicardo Catalinas Jiménez2016-02-221-0/+3
| | | | | This hash function is slightly different from the standarized NIST SHA-3 as both of them use different domain separation bits.
* crypto/sha3: Remove import path checking from vendored codeRicardo Catalinas Jiménez2016-02-221-1/+1
|
* crypto/sha3: Copy latest code from "golang.org/x/crypto/sha3"Ricardo Catalinas Jiménez2016-02-2213-0/+1269
| | | | Revision: 1f22c0103821b9390939b6776727195525381532
* crypto/sha3: Delete old copied codeRicardo Catalinas Jiménez2016-02-222-671/+0
|
* Merge pull request #2116 from obscuren/homesteadJeffrey Wilcke2016-02-193-3/+16
|\ | | | | core, core/vm: consensus changes necessary for the homestead release
| * parmas, crypto, core, core/vm: homestead consensus protocol changesGustav Simonsson2016-02-183-3/+16
| | | | | | | | | | | | | | | | * change gas cost for contract creating txs * invalidate signature with s value greater than secp256k1 N / 2 * OOG contract creation if not enough gas to store code * new difficulty adjustment algorithm * new DELEGATECALL op code
* | crypto/ecies: make authenticated shared data workFelix Lange2016-02-122-6/+36
|/ | | | The s2 parameter was not actually written to the MAC.
* Merge pull request #2056 from fjl/fix-account-formatJeffrey Wilcke2015-12-101-8/+8
|\ | | | | crypto: "Crypto" -> "crypto" in web3 key format
| * crypto: "Crypto" -> "crypto" in web3 key formatFelix Lange2015-12-081-8/+8
| |
* | crypto/secp256k1: remove dependency on libgmpFelix Lange2015-12-042-33/+1
|/ | | | | Turns out we actually don't need it, USE_NUM_NONE works because we also set USE_FIELD_INV_BUILTIN.
* crypto, crypto/ecies, crypto/secp256k1: libsecp256k1 scalar multGustav Simonsson2015-11-3012-164/+311
| | | | thanks to Felix Lange (fjl) for help with design & impl
* core/secp256k1: update libsecp256k1 Go wrapper and testsGustav Simonsson2015-11-302-18/+17
|
* crypto/secp256k1: drop pkgsrc paths from CFLAGSFelix Lange2015-11-171-2/+2
| | | | | | They cause compiler warnings for people who don't have these directories. People with pkgsrc can add the directory through CGO_CFLAGS instead.
* crypto/secp256k1: raise internal errors as recoverable Go panicFelix Lange2015-11-172-0/+39
|
* crypto/secp256k1: verify recovery ID before calling libsecp256k1Felix Lange2015-11-172-79/+48
| | | | | | | | The C library treats the recovery ID as trusted input and crashes the process for invalid values, so it needs to be verified before calling into C. This will inhibit the crash in #1983. Also remove VerifySignature because we don't use it.
* crypto/secp256k1: add C compiler flags for pkgsrcFelix Lange2015-11-031-2/+2
| | | | | pkgsrc is a cross-platform package manager that also supports OS X.
* cmd/utils, crypto: add --lightkdf flag for lighter KDFDrake Burroughs2015-10-293-18/+27
|
* console:zelig2015-10-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lines with leading space are ommitted from history * exit processed even with whitespace around * all whitespace lines (not only empty ones) are ignored add 7 missing commands to admin api autocomplete registrar: methods now return proper error if reg addresses are not set. fixes #1457 rpc/console: fix personal.newAccount() regression. Now all comms accept interactive password registrar: add registrar tests for errors crypto: catch AES decryption error on presale wallet import + fix error msg format. fixes #1580 CLI: improve error message when starting a second instance of geth. fixes #1564 cli/accounts: unlock multiple accounts. fixes #1785 * make unlocking multiple accounts work with inline <() fd * passwdfile now correctly read only once * improve logs * fix CLI help text for unlocking fix regression with docRoot / admin API * docRoot/jspath passed to rpc/api ParseApis, which passes onto adminApi * docRoot field for JS console in order to pass when RPC is (re)started * improve flag desc for jspath common/docserver: catch http errors from response fix rpc/api tests common/natspec: fix end to end test (skipped because takes 8s) registrar: fix major regression: * deploy registrars on frontier * register HashsReg and UrlHint in GlobalRegistrar. * set all 3 contract addresses in code * zero out addresses first in tests
* Merge pull request #1853 from Gustav-Simonsson/libsecp256k1_updateJeffrey Wilcke2015-10-1689-3022/+6536
|\ | | | | Update libsecp256k1, Go wrapper and tests
| * core/secp256k1: update libsecp256k1 Go wrapper and testsGustav Simonsson2015-10-093-249/+256
| |
| * Update libsecp256k1Gustav Simonsson2015-09-2886-2773/+6280
| |
* | Merge pull request #1887 from Gustav-Simonsson/icapJeffrey Wilcke2015-10-162-0/+30
|\ \ | | | | | | common, crypto: add ICAP functions
| * | common, crypto: add ICAP functionsGustav Simonsson2015-10-132-0/+30
| |/
* / crypto: correct sig validation, add more unit testsGustav Simonsson2015-09-222-27/+169
|/
* Change go-uuid to use the current supported repository.Jeff R. Allen2015-09-123-3/+3
|
* crypto: remove obsolete key fileszelig2015-08-184-1878/+0
|
* remove elliptic.P224 usagePavol Rusnak2015-07-302-14/+1
| | | | | | | Fedora/RedHat distros comply with US patent law and remove this curve, which makes it impossible to run ethereum with distro provided Golang. File crypto/ecies/README claims it is unsupported anyway.
* FreeBSD supportFynn2015-07-291-0/+2
|
* Merge pull request #1515 from fjl/license-fixesJeffrey Wilcke2015-07-2817-19/+67
|\ | | | | all: fix license headers one more time
| * crypto/sha3: add full license headersFelix Lange2015-07-242-4/+52
| |
| * all: fix license headers one more timeFelix Lange2015-07-2415-15/+15
| | | | | | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* | crypto: fix build with Go 1.5Felix Lange2015-07-281-1/+8
|/
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-2315-60/+60
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* crypto: fix license of curve.goFelix Lange2015-07-231-27/+38
| | | | | crypto/curve.go is not our code and has its own license. This commit excludes it in update-license.go and removes our GPL header.
* crypto: remove debug print call after decrypting a key from diskFelix Lange2015-07-211-1/+0
|
* : colon => dash - in keyfile name - slight deviation from ISO8601 for WIN ↵zelig2015-07-091-1/+1
| | | | FS compatibility
* all: goimports -wFelix Lange2015-07-071-1/+2
|
* all: remove @author commentsFelix Lange2015-07-073-21/+0
|
* all: update license informationFelix Lange2015-07-0720-47/+371
|
* account update: migrate or change passwordzelig2015-07-032-18/+60
| | | | | | * account.Update * KeyStore.Cleanup * fix dir rm for old format deleteKey
* fix account orderingzelig2015-07-033-73/+96
| | | | | | | | * chronological order of creation * new naming scheme keystore/UTC--<created_at UTC ISO8601>-<address hex> * KeyStore2 -> KeyStore * backward compatibility * refactor keyStore methods
* accounts order by keyfile ctimezelig2015-07-031-2/+25
|
* Change keystore to version 3Gustav Simonsson2015-06-247-91/+344
| | | | | | | | | | | | * Change password protection crypto in keystore to version 3 * Update KeyStoreTests/basic_tests.json * Add support for PBKDF2 with HMAC-SHA256 * Change MAC and encryption key to avoid unnecessary hashing * Add tests for test vectors in new wiki page defining version 3 * Add tests for new keystore tests in ethereum/tests repo * Move JSON loading util to common for use in both tests and crypto packages * Add backwards compatibility with key store version 1
* crypto: return common.Address rather than raw bytesobscuren2015-06-052-5/+5
|
* Merge pull request #1166 from Gustav-Simonsson/add_ec_sig_validationsJeffrey Wilcke2015-06-031-0/+16
|\ | | | | Add EC signature validations before call to libsecp256k1
| * Initialise curve N value in package initGustav Simonsson2015-06-031-1/+3
| |
| * Add EC signature validations before call to libsecp256k1Gustav Simonsson2015-06-021-0/+14
| |
* | crypto/sha3: pull in latest keccak from go crypto (45% speed increase)Péter Szilágyi2015-06-032-173/+409
|/
* Update keystore code commentsGustav Simonsson2015-05-141-6/+7
|
* Change default keystore dirGustav Simonsson2015-05-131-1/+1
|
* Update key store to new spec but keep address field for nowGustav Simonsson2015-05-123-68/+55
| | | | * Also fix address types post-rebase
* Address pull request comments; key header and hex encodingGustav Simonsson2015-05-123-31/+67
| | | | | | * Remove key header from unencrypted key file format and replace it with a version field * Change encoding of bytes in key files from base64 to hex
* Revert "Add key header to unencrypted key file"Gustav Simonsson2015-05-122-16/+8
| | | | This reverts commit a94d4ba0b53c4558ab838aaed635a2ff66ddfa53.
* Add key header to unencrypted key fileGustav Simonsson2015-05-122-8/+16
|
* Add key header to encrypted keysGustav Simonsson2015-05-122-7/+57
| | | | | | | * Add key header containing key version, kdf and kdf params * Store key header as JSON in the key file * Read in KDF params from key header * Include key header in MAC calculation and MAC verification
* Use common.Address type for accounts.AddressGustav Simonsson2015-05-124-28/+30
|
* Improve key store passphrase cryptoGustav Simonsson2015-05-124-23/+31
| | | | | | | * Change MAC-then-Encrypt to Encrypt-then-MAC * Change AES256 to AES128 * Use first 16 bytes of KDF derived key for AES and remaining 16 for MAC
* Remove the awesome, ever misunderstood entropy mixingGustav Simonsson2015-05-124-64/+15
|
* replaced several path.* with filepath.* which is platform independentBas van Kervel2015-05-122-7/+7
|
* Add loading of block test privkey if presentGustav Simonsson2015-04-281-0/+13
|
* Remove unneeded allocationGustav Simonsson2015-04-251-1/+0
|
* Use make instead of new for allocationGustav Simonsson2015-04-241-1/+1
|
* Fix ignore of unexpected files in key dirGustav Simonsson2015-04-231-3/+3
|
* doc: crypto/secp256k1 GMP dependency package name.Noel Maersk2015-04-231-1/+4
| | | | | | | | | | | | | | Linux build documentation is mostly geared towards Ubuntu 14.04 (LTS). Appropriate package is called `libgmp-dev` there. Note that on pristine installations building `geth` with godep will fail because this header is missing. This is not documented in the top-level README, but is on the wiki: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Ubuntu#building-geth-command-line-client That page recommends `libgmp3-dev`, which ATM provides same version as `libgmp-dev`.
* Adding flags to facilitate cross compiling to ARMMaran2015-04-221-0/+2
|
* crypto: update {Load,Save}ECDSA comments to mention hex encodingFelix Lange2015-04-191-2/+3
|
* removed utility function and implemented hex conversation in crypto functionsBas van Kervel2015-04-091-2/+9
|
* Support for import/export hex encoded keys, closes #635Bas van Kervel2015-04-091-3/+3
|
* Add IsOnCurve check to EC unmarshalling in ECIES decryptionGustav Simonsson2015-04-081-0/+4
|
* Merge pull request #648 from ↵Jeffrey Wilcke2015-04-081-9/+7
|\ | | | | | | | | Gustav-Simonsson/forward_ecrecover_err_and_remove_dup_checks Forward and log EC recover err and remove dup pubkey len check
| * Forward and log EC recover err and remove dup pubkey len checkGustav Simonsson2015-04-071-9/+7
| |
* | libsecp256k1 #define NDEBUGGustav Simonsson2015-04-081-0/+1
| |
* | Link GMPobscuren2015-04-071-0/+3
| |
* | Update Go wrapper around libbsecp256k1Gustav Simonsson2015-04-071-89/+25
| |
* | Update bitcoin secp256k1 libGustav Simonsson2015-04-0774-4960/+10508
|/
* Cleanup.obscuren2015-03-291-9/+7
|
* common: remove WriteFile and ReadAllFile (use ioutil instead)zelig2015-03-271-2/+4
|
* import/export accountszelig2015-03-272-7/+16
| | | | | | | | | | | - cli: add passwordfile flag - cli: change unlock flag only takes account - cli: with unlock you are prompted for password or use passfile with password flag - cli: unlockAccount used in normal client start (run) and accountExport - cli: getPassword used in accountCreate and accountImport - accounts: Manager.Import, Manager.Export - crypto: SaveECDSA (to complement LoadECDSA) to save to file - crypto: NewKeyFromECDSA added (used in accountImport and New = generated constructor)
* crypto: remove use of common.Value.EncodeFelix Lange2015-03-201-9/+1
| | | | This seems to be the last remaining use of it.
* Merge remote-tracking branch 'ethereum/conversion' into conversionFelix Lange2015-03-171-2/+5
|\
| * converted vmobscuren2015-03-171-2/+5
| |
* | crypto: fix Sha3Hash and add a test for itFelix Lange2015-03-172-2/+8
|/
* crypto: add Sha3HashFelix Lange2015-03-171-1/+10
|
* Moved ethutil => commonobscuren2015-03-165-21/+21
|
* Use ECDSA instead of ellipticobscuren2015-03-111-6/+3
|
* crypto: delete old key management stuffFelix Lange2015-03-104-492/+0
|
* Fix key store address hex decoding and accounts testGustav Simonsson2015-02-251-2/+5
| | | | Thanks to https://github.com/jaekwon for original fix!
* Implement OS sensitive dataDirsMaran2015-02-232-11/+5
|
* crypto: switch to golang.org/x/cryptoFelix Lange2015-02-172-5/+7
| | | | | code.google.com/p/go.crypto is deprecated and will cause problems in future versions of Go.
* Added invalid sec key testobscuren2015-02-161-1/+10
|
* Validate seckey when generating pub keyobscuren2015-02-151-1/+6
|
* Moved ECIES to repo & added secondary title for webviewobscuren2015-02-141-1/+1
| | | | | * ECIES moved from obscuren to ethereum * Added html META[name=badge] to reflect menuItem.secondaryTitle
* Add 'crypto/ecies/' from commit '7c0f4a9b18d992166452d8cd32caaefd92b26386'obscuren2015-02-147-0/+1703
| | | | | | git-subtree-dir: crypto/ecies git-subtree-mainline: 49a739c8d647739b3d815966f8854a4e9978df56 git-subtree-split: 7c0f4a9b18d992166452d8cd32caaefd92b26386
* Merge branch 'align_key_and_ecdsa_nonce_entropy' of ↵obscuren2015-02-146-125/+105
|\ | | | | | | https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-align_key_and_ecdsa_nonce_entropy
| * Remove secp256_rand.go and update testsGustav Simonsson2015-02-142-107/+11
| |
| * Unexport randEntropy type and use exported Reader insteadGustav Simonsson2015-02-132-5/+7
| |
| * Set both key generation and ECDSA nonce to use mixed entropyGustav Simonsson2015-02-114-18/+92
| | | | | | | | | | | | * Move random entropy functions to new package randentropy * Add function to get n bytes entropy where up to first 32 bytes are mixed with OS entropy sources
* | crypto: add key loading functionsFelix Lange2015-02-102-1/+30
| |
* | crypto: make it easier to run Sha3 on multiple inputsFelix Lange2015-02-062-4/+5
|/ | | | | crypto.Sha3(append(foo, bar)) --> crypto.Sha3(foo, bar) crypto.Sha3([]byte{}) --> crypto.Sha3()
* Merge branch 'bounty' into developobscuren2015-02-011-1/+2
|\
| * Fixed nobscuren2015-02-011-1/+2
| |
* | Merge branch 'bounty' into developobscuren2015-02-012-6/+2
|\|
| * Fixed Sign nonceobscuren2015-02-012-6/+2
| |
* | Fixed whisper pub key bugobscuren2015-01-301-1/+1
| | | | | | | | | | * Unrecoverable messages would cause segfault when recovering invalid pub key
* | Address pull request commentsGustav Simonsson2015-01-283-8/+7
| | | | | | | | | | | | | | | | | | * Use crypto.Sign instead of directly calling secp256k1 lib * Rename UserAccount to Account and Addr to Address (for consistency) * Change AccountManager.Sign to take ptr to Account instead of address byte array * Simplify copying of Accounts in Accounts() * PubkeyToAddress and GetEntropyCSPRNG now exported
* | Add accounts package and refactor key storesGustav Simonsson2015-01-265-55/+87
| | | | | | | | | | | | | | | | * Add initial UserAccount and AccountManager structs * Add NewAccount, Sign and Accounts functions * Refactor key stores to use key address as main identifier while keeping the UUID. * Use key address as file/dir names instead of UUID
* | Merge branch 'import_presale_keys' of ↵obscuren2015-01-234-49/+124
|\ \ | |/ |/| | | | | | | | | https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-import_presale_keys Conflicts: crypto/crypto.go
| * CamelCase aesCBCDecryptGustav Simonsson2015-01-222-3/+3
| |
| * Add ImportPreSaleKeyGustav Simonsson2015-01-214-49/+123
| | | | | | | | | | | | * ImportPreSaleKey takes a KeyStore, a presale key JSON (e.g. file content) and a password string. It stores the key in the given key store. * Refactored common AES decryption and moved some functions to crypto.go
* | Use curve params instead of hardcoded 32 bytesobscuren2015-01-231-1/+1
| |
* | Pad private key when signing & length check for hashes in signobscuren2015-01-232-2/+19
|/
* Moved `obscuren` secp256k1-goobscuren2015-01-2250-3/+6430
|
* Moved sha3 from `obscuren`obscuren2015-01-223-1/+388
|
* Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into developobscuren2015-01-204-0/+551
|\
| * Address pull request commentsGustav Simonsson2015-01-202-9/+4
| | | | | | | | | | * Further simplify "constructor" function's allocation of structs * Fix formatting
| * Address pull request commentsGustav Simonsson2015-01-202-10/+8
| | | | | | | | | | * Allocate with composite literal instead of new * Remove check of number of bytes read from rand
| * Update code commentsGustav Simonsson2015-01-161-6/+4
| |
| * Address pull request commentsGustav Simonsson2015-01-164-215/+88
| | | | | | | | | | | | | | | | * Remove flags field from key struct * Change JSON struct fields from string to []byte * Change GenerateNewKey API to take io.Reader for random source * Remove mixing entropy source function * Use testing Fatal in tests
| * Address pull request commentsGustav Simonsson2015-01-164-84/+91
| | | | | | | | | | | | | | | | | | * Simplify scrypt constants with const block * Add key store constructors and make their types private * Simplify key store and file namings to be less Java Enterprise™ * Change test error logging to use t.Error(err) * Reduce number of naked returns (just like my ex-gf) * Simplify file reading path code
| * Add new key_store interface and two new key storesGustav Simonsson2015-01-164-0/+680
| | | | | | | | | | | | | | * Add new generic key_store interface * Add new plaintext key store storing unprotected keys on disk * Add new encrypted key store storing encrypted keys on disk * Add new entropy mixing function using OS and go runtime sources
* | Added 0 key proof errorobscuren2015-01-191-0/+13
|/ | | | | Private key \x00\x00...\x00 returns the _exact_ same public key as \x11 \x11...\x11. Currently investigating.
* pre-powobscuren2015-01-121-0/+13
|
* fixed testsobscuren2014-12-131-1/+1
|
* Added length checkesobscuren2014-12-131-1/+18
|
* Changed new methods to use ecdsa package for pub prv keysobscuren2014-12-102-26/+35
|
* Added Encrypt & Decrypt using the ECIES w/ testsobscuren2014-12-102-0/+82
|
* Added S256 curveobscuren2014-12-101-0/+363
|
* Show newly created private key during startup. Closes #126obscuren2014-12-051-0/+4
|
* try to get full coverage report on travisTaylor Gerring2014-11-151-109/+109
|
* ethcrypto => cryptoobscuren2014-10-3110-0/+2393