aboutsummaryrefslogtreecommitdiff
path: root/src/crypto (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-04keccak: guard against misaligned memory accesses on ARMmoneromooo-monero1-3/+6
The code generated is exactly the same as the direct access one on x86_64
2019-06-14ensure no NULL is passed to memcpymoneromooo-monero1-1/+2
NULL is valid when size is 0, but memcpy uses nonnull attributes, so let's not poke the bear
2019-06-14tree-hash: allocate variable memory on heap, not stackmoneromooo-monero1-5/+7
Large amounts might run out of stack Reported by guidov
2019-04-04crypto: replace rand<T>()%N idiom with unbiased rand_idx(N)stoffu1-0/+27
2019-03-24Fix build on FreeBSDNathan Dorfman1-1/+1
2019-03-21slow-hash: default to JIT on x86_64moneromooo-monero1-1/+1
2019-03-20crypto: hmac_keccak addedDusan Klinec3-0/+142
2019-03-07slow-hash: cache TLS references locally once at function startmoneromooo-monero1-27/+31
2019-03-07crypto: fix PaX issue on NetBSD with CNv4 JITmoneromooo-monero2-9/+24
2019-03-07aesb: avoid stomping on an existing define on NetBSDmoneromooo-monero1-4/+4
2019-03-05Update 2019 copyrightbinaryFate31-31/+31
2019-03-05CryptonightR: define out i386/x86_64 specific code on other archsmoneromooo-monero2-0/+8
2019-03-05slow-hash: fix build on armmoneromooo-monero4-27/+42
2019-03-04tests: add a CNv4 JIT testmoneromooo-monero1-7/+8
2019-03-04crypto: plug CNv4 JIT into cn_slow_hashmoneromooo-monero2-3/+100
Enabled by setting the MONERO_USE_CNV4_JIT env var to 1
2019-03-04crypto: clear cache after generating random programmoneromooo-monero1-0/+3
2019-03-04CNv4 JIT compiler for x86-64 and testsSChernykh4-0/+2746
Minimalistic JIT code generator for random math sequence in CryptonightR. Usage: - Allocate writable and executable memory - Call v4_generate_JIT_code with "buf" pointed to memory allocated on the previous step - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
2019-02-25discontinue use of allocamoneromooo-monero1-12/+2
NetBSD emits: warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. not -std=c89). and man 3 alloca says: Normally, gcc(1) translates calls to alloca() with inlined code. This is not done when either the -ansi, -std=c89, -std=c99, or the -std=c11 option is given and the header <alloca.h> is not included. Otherwise, (without an -ansi or -std=c* option) the glibc version of <stdlib.h> includes <alloca.h> and that contains the lines: #ifdef __GNUC__ #define alloca(size) __builtin_alloca (size) #endif It looks like alloca is a bad idea in modern C/C++, so we use VLAs for C and std::vector for C++.
2019-02-14Fixed path to int-util.hSChernykh1-1/+1
2019-02-14Adding cnv4-2 tweaksSChernykh2-39/+79
Co-Authored-By: Lee Clagett <vtnerd@users.noreply.github.com>
2019-02-14Cryptonight variant 4 aka CryptonightRSChernykh5-16/+507
It introduces random integer math into the main loop.
2018-12-04move int-util.h to epeemoneromooo-monero7-7/+7
2018-11-16slow-hash: some more big endian fixesxiphon1-6/+6
2018-11-16slow-hash: fix for big endianmoneromooo-monero1-20/+21
2018-11-15Removed a lot of unnecessary includesMartijn Otto2-4/+0
2018-10-31crypto: fix AES encryption on big endianxiphon1-2/+3
2018-10-29hash: fix hash_permutation on big endianmoneromooo-monero1-0/+7
2018-10-25crypto: fixed groestl on big-endian platformsxiphon2-47/+91
2018-10-23Small function declaration cleanup in slow-hash.cPol Mauri1-5/+2
- These functions are declared twice in slow-hash.c. Remove one of the copies. - The declarations have the wrong return type, should be void, not int. Function definitions here: https://github.com/monero-project/monero/blob/1e74586ee99e4bd89626d2eb4d23883cd91f0f81/src/crypto/aesb.c#L151-L180 Test plan: make release-test
2018-10-22crypto: fixed incremental keccak API on big-endian platformsxiphon1-2/+3
2018-09-29Merge pull request #4449Riccardo Spagni1-2/+41
17142ec9 malloc scratchpad for all supported android archs (m2049r)
2018-09-26malloc scratchpad for all supported android archsm2049r1-2/+41
2018-09-22cryptonote tweak v2.2Lee Clagett1-0/+20
2018-09-17Fixed Keccak implementation on big-endian platformsAlexandro Sanchez1-3/+8
2018-09-11NetBSD supportthomasvaughan3-8/+10
2018-09-11more comprehensive test for ge_p3 comparison to identity/point at infinitymoneromooo-monero2-0/+15
Reported by QuarksLab.
2018-09-11crypto: some paranoid checks in generate_signature/check_signaturemoneromooo-monero1-1/+11
Reported by QuarksLab.
2018-09-11crypto: never return zero in random32_unbiasedmoneromooo-monero1-1/+1
This avoids problems when the caller can't deal with a zero walue, which happens often enough that it's worth nipping the problem in the bud.
2018-09-11bulletproofs: a few fixes from the Kudelski reviewmoneromooo-monero1-2/+1
- fix integer overflow in n_bulletproof_amounts - check input scalars are in range - remove use of environment variable to tweak straus performance - do not use implementation defined signed shift for signum
2018-09-11precalc the ge_p3 representation of Hmoneromooo-monero2-0/+7
2018-09-09Cryptonight variant 2SChernykh2-54/+361
Contains two modifications to improve ASIC resistance: shuffle and integer math. Shuffle makes use of the whole 64-byte cache line instead of 16 bytes only, making Cryptonight 4 times more demanding for memory bandwidth. Integer math adds 64:32 bit integer division followed by 64 bit integer square root, adding large and unavoidable computational latency to the main loop. More details and performance numbers: https://github.com/SChernykh/xmr-stak-cpu/blob/master/README.md
2018-09-09crypto_ops_builder: link to EdDSA/Ed25519 draft RFCmoneromooo-monero1-1401/+3
instead of including the text, as it's not fully free to redistribute
2018-08-23add and use constant time 32 byte equality functionmoneromooo-monero3-5/+26
2018-08-16crypto: make secret_key automatically mlockmoneromooo-monero2-6/+8
2018-08-15Incremental Keccak API addedDusan Klinec2-0/+88
- needed for TREZOR integration
2018-08-08wallet: allow adjusting number of rounds for the key derivation functionstoffu1-4/+8
2018-07-20crypto: do not use boost::value_initialized to init null skey/pkeymoneromooo-monero2-3/+2
2018-07-15crypto: move null_pkey/null_skey to the cpp filemoneromooo-monero2-2/+5
2018-07-05crypto: remove slight bias in key generation due to modulomoneromooo-monero2-4/+25
2018-06-28crypto: remove unused unsafe random scalar generatormoneromooo-monero1-6/+0
2018-06-23Changed URLs to HTTPSeinsteinsfool7-10/+10
2018-06-18crypto: add a README pointing to the SUPERCOP licencemoneromooo-monero1-0/+4
2018-05-13crypto: more places needing fixing for GCC 8.1moneroexamples1-10/+10
2018-05-13chacha: fix build with GCC 8.1moneromooo-monero1-2/+2
2018-04-24slow-hash: fix memory leak for Windows /karbowanec#41aivve1-1/+1
2018-04-10crypto: fix initialization order issue with random mutexmoneromooo-monero2-10/+15
2018-03-14chacha: call prehashed version explicitly as generate_chacha_key_prehashedstoffu4-16/+34
hash: add prehashed version cn_slow_hash_prehashed slow-hash: let cn_slow_hash take 4th parameter for deciding prehashed or not slow-hash: add support for prehashed version for the other 3 platforms
2018-03-14crypto: revert odd namespace changes made in #3303stoffu2-10/+1
2018-03-14device: untangle cyclic depenencystoffu3-89/+0
When #3303 was merged, a cyclic dependency chain was generated: libdevice <- libcncrypto <- libringct <- libdevice This was because libdevice needs access to a set of basic crypto operations implemented in libringct such as scalarmultBase(), while libringct also needs access to abstracted crypto operations implemented in libdevice such as ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct into libringct_basic and libringct, where the basic crypto ops previously in libringct are moved into libringct_basic. The cyclic dependency is now resolved thanks to this separation: libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct This eliminates the need for crypto_device.cpp and rctOps_device.cpp. Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and get_subaddress_secret_key() were previously implemented in libcryptonote_basic (cryptonote_format_utils.cpp) and were then called from hw::core::device_default, which is odd because libdevice is supposed to be independent of libcryptonote_basic. Therefore, those functions were moved to device_default.cpp.
2018-03-14device: made function prototypes consistent with pre-#3303 codebasestoffu1-6/+2
2018-03-07slow-hash: fix uint64 type typomoneromooo-monero1-1/+1
2018-03-05tweaks to the monerov1 cryptonight algorithmLee Clagett1-16/+52
2018-03-05slow-hash: optimized versionSChernykh1-4/+4
2018-03-05Monero Cryptonight variants, and add one for v7moneromooo-monero4-12/+53
This is the first variant of many, with the intent to improve Monero's resistance to ASICs and encourage mining decentralization.
2018-03-05Correct spelling mistakes.Edward Betts1-1/+1
2018-03-04Code modifications to integrate Ledger HW device into monero-wallet-cli.cslashm7-6/+115
The basic approach it to delegate all sensitive data (master key, secret ephemeral key, key derivation, ....) and related operations to the device. As device has low memory, it does not keep itself the values (except for view/spend keys) but once computed there are encrypted (with AES are equivalent) and return back to monero-wallet-cli. When they need to be manipulated by the device, they are decrypted on receive. Moreover, using the client for storing the value in encrypted form limits the modification in the client code. Those values are transfered from one C-structure to another one as previously. The code modification has been done with the wishes to be open to any other hardware wallet. To achieve that a C++ class hw::Device has been introduced. Two initial implementations are provided: the "default", which remaps all calls to initial Monero code, and the "Ledger", which delegates all calls to Ledger device.
2018-02-16crypto: add missing include (WIN32)iDunk54001-0/+1
2018-02-07keccak: fix mdlen bounds sanity checkingmoneromooo-monero1-1/+2
found by h908714124
2018-02-02keccak: fix sanity check bounds testmoneromooo-monero1-1/+1
Nothing calls this with those inputs
2018-02-01call _exit instead of abort in release modemoneromooo-monero3-7/+33
Avoids cores being created, as they're nowadays often piped to some call home system
2018-01-26Update 2018 copyrightxmr-eric31-31/+31
2018-01-25Support building cncrypto lib with msvcMatt Little3-5/+15
2018-01-15crypto: add a ge_p3_identity constantmoneromooo-monero2-0/+2
2018-01-15crypto: add scalar mult functions returning ge_p3 instead of ge_p2moneromooo-monero2-0/+155
ge_scalarmult_p3 ge_double_scalarmult_precomp_vartime2_p3 ge_double_scalarmult_base_vartime_p3 This makes it possible to reuse the result without having to convert back to unsigned char[32] and back to ge types.
2018-01-10fix some link errors in debug mode for macosstoffu1-0/+1
2018-01-10move memwipe to epee to avoid common<->crypto circular dependenciesmoneromooo-monero2-2/+2
2017-12-25Add a chacha20 variant to go with chacha8moneromooo-monero3-17/+32
2017-12-22blake256: fix wrong hash when computed in partsmoneromooo-monero1-1/+1
This does not happen when used by the monero code
2017-12-16Scrub keys from memory just before scope end.moneromooo-monero2-17/+10
Partially implements #74. Securely erases keys from memory after they are no longer needed. Might have a performance impact, which I haven't measured (perf measurements aren't generally reliable on laptops). Thanks to @stoffu for the suggestion to specialize the pod_to_hex/hex_to_pod functions. Using overloads + SFINAE instead generalizes it so other types can be marked as scrubbed without adding more boilerplate.
2017-12-07add a version of ge_double_scalarmult_precomp_vartime with A precompmoneromooo-monero2-3/+9
2017-12-07sc_mul and sc_muladdluigi11112-0/+654
2017-11-27use memwipe in a few relevant placesmoneromooo-monero1-2/+3
2017-11-14make this build on SunOS/SolarisPavel Maryanov1-0/+5
2017-11-11kaccak: remove unused return valuemoneromooo-monero2-4/+2
2017-11-07keccak: some paranoid "can't happen" checksmoneromooo-monero1-0/+14
2017-10-07Subaddresseskenshi842-41/+111
2017-10-06Fix building with -DARCH=default -DNO_AES=ONmoneromooo-monero1-2/+2
2017-09-25move checkpoints in a separate librarymoneromooo-monero2-0/+35
2017-08-23crypto: use malloc instead of allocamoneromooo-monero1-10/+9
2017-06-22crypto: moved boost::lock_guard into a smaller scopestoffu1-4/+5
2017-06-22Signature proving payment to destination by only revealing key derivation, ↵stoffu2-0/+139
not the actual tx secret key
2017-06-08Fix #1991 asm multiply againHoward Chu1-16/+13
Tweak temp variables and constraints. Was working before if not inlined but newer gcc tends to inline it.
2017-05-23changed crypto to cncrypto so it generated libcncryptoGentian1-3/+3
fix a cmakelist
2017-04-12Clean up ARMv8-a aes_expand_key()hyc1-24/+16
The inline asm was lying about its parameters
2017-04-03IOS CMAKE build settingsJaquee1-1/+1
2017-03-25Silence warning about possibly uninitialized pointerGuillaume LE VAILLANT1-1/+1
2017-03-14Specify "524,288" iterations instead of "500,000"darentuzi1-5/+5
CryptoNight does exactly 524,288 iterations over the scratchpad as defined in CNS008, saying 500,000 could be confusing. I know its meant to give a rough idea (around 500k) to the reader but if you are reading the code, might as well know the exact number.
2017-02-21update copyright year, fix occasional lack of newline at line endRiccardo Spagni31-31/+31
2017-02-13Fix compiler error about nested externs in slow_hash.c by moving declarationsNanoAkron1-3/+3
2017-01-05Build wallet with Android NDKMoroccanMalinois3-4/+24
2016-12-22cleaner log calc algorithmfireice-uk1-20/+18
2016-12-15Preliminary support for DragonFly BSDAntonio Huete Jimenez4-4/+6
- It builds but no further testing has been done.
2016-12-10oaes_lib: fix a leak on OOM error pathmoneromooo-monero1-0/+3
found by coverity
2016-11-07wallet: fix output collision detection for view walletsmoneromooo-monero1-1/+1
View wallets do not have the spend secret key, and are thus unable to derive key images for incoming outputs. Moreover, a previous patch set key images to zero as a means to mark an output as having an unknown key image, so they could be filled in when importing key images at a later time. That later patch caused spurious collisions. We now use public keys to detect duplicate outputs. Public keys obtained from the blockchain are checked to be identical to the ones derived locally, so can't be spoofed.
2016-10-29Changed to ..._HASHBITS everywhere for consistencyNanoAkron1-2/+2
2016-09-26Dropped "bit" from bitmonero.Randi Joseph1-2/+2
2016-09-26Dropped "bit" from bitmonero.Randi Joseph1-2/+2
2016-09-18cmake: transitive deps and remove deprecated LINK_*redfish1-0/+5
Keep the immediate direct deps at the library that depends on them, declare deps as PUBLIC so that targets that link against that library get the library's deps as transitive deps. Break dep cycle between blockchain_db <-> crytonote_core. No code refactoring, just hide cycle from cmake so that it doesn't complain (cycles are allowed only between static libs, not shared libs). This is in preparation for supproting BUILD_SHARED_LIBS cmake built-in option for building internal libs as shared.
2016-09-18crypto: armv7: slow-hash: remove redundant source includeredfish1-1/+0
aesb.c is already present in libcrypto as a standalone object. Tested: builds and runs fine on armv7, static and dynamic.
2016-09-16Add ARMv8-A AES supportHoward Chu1-42/+295
More than twice as fast as plain C code. Note that both ARMv7 and ARMv8 can be further improved with better use of NEON. Also tweak ARMv7 multiplier
2016-09-04crypto,cmake: enable ASM mul impl on ARM; add cmake optredfish2-3/+13
This was disabled earlier as part of diagnosing failing tests on ARM, which turned out to be due to aliasing, fixed by adding -fno-strict-aliasing. So, re-enabling it back.
2016-08-28rct amount key modified as per luigi1111's recommendationsmoneromooo-monero2-1/+6
This allows the key to be not the same for two outputs sent to the same address (eg, if you pay yourself, and also get change back). Also remove the key amounts lists and return parameters since we don't actually generate random ones, so we don't need to save them as we can recalculate them when needed if we have the correct keys.
2016-08-28crypto: error out where appropriatemoneromooo-monero1-2/+2
2016-08-28ringct: import of Shen Noether's ring confidential transactionsmoneromooo-monero5-13/+35
2016-05-25crypto: slow-hash: disable mul implemented in asm for ARMredfish1-2/+5
The implementation of mul in asm breaks 'slow-hash' test when built with GCC 6.1.1. Disable this implementation in favor of plain C until it is fixed.
2016-05-18crypto: slow-hash: fix misleading indentredfish1-1/+1
GCC warned about this one.
2016-05-18crypto: slow-hash: remove unused hash list for ARMredfish1-4/+0
This list is already defined within the function. The removed definition was shadowed.
2016-05-18crypto: oaes_lib: remove unused _NR arrayredfish1-4/+0
2016-05-18crypto: fix compile error: use named type in sizeofredfish1-4/+5
Btw, the warning 4200 remains disabled, but it did not get triggered (GCC 6.1.1, ARM). But, perhaps a better way than disabling the warning would be to do what is suggested here: http://stackoverflow.com/questions/3350852/how-to-correctly-fix-zero-sized-array-in-struct-union-warning-c4200-without%3E
2016-05-15crypto: make clear generate_random_bytes is not thread safemoneromooo-monero4-4/+11
And add a thread safe version to encourage proper use
2016-04-24random: call abort(3) instead of assert in must_succeed macromoneromooo-monero1-1/+1
Avoids silent use of bad RNG in release builds, in case those calls might actually fail. Reported by smooth.
2016-03-11minor tweaks, add readme for crypto_ops_builderRiccardo Spagni3-4/+25
2016-03-11minor tweaks, add readme for crypto_ops_builderRiccardo Spagni3-4/+25
2016-03-11Use boost::thread instead of std::threadHoward Chu2-10/+10
and all other associated IPC
2016-02-09crypto: only check MONERO_USE_SOFTWARE_AES oncemoneromooo-monero1-5/+15
2016-02-09crypto: use software AES based on the MONERO_USE_SOFTWARE_AES env varmoneromooo-monero1-1/+11
Setting to no or 0 also works. If set, any other value enables it. Useful for running with valgrind in cases where it fails at properly implementing AES-NI.
2016-01-21OpenBSD support for Monero.me0wmix4-9/+9
2016-01-11Fix arm asmHoward Chu1-24/+64
About 10% faster than plain C mul128 on raspi1B
2015-12-31updated copyright yearRiccardo Spagni30-30/+30
2015-12-15Replace tabs with two spaces for consistency with rest of codebasewarptangent2-162/+162
Remove trailing whitespace in same files.
2015-10-26renamed folderRiccardo Spagni174-4830/+0
2015-10-15renamed folderRiccardo Spagni174-4830/+0
2015-08-26Re-enable optimized slow-hash if someone is trying to compile w/MSVC ↵Javier Smooth1-1/+1
(disabling it was unintentional)
2015-08-23Added ref10 shen_ed25519_ref code, which includes code that can replace ↵ShenNoether174-0/+23117
crypto-ops with a version straight from Bernstein's ref 10
2015-08-23revert to 776b4fc91a821be152f0f23e6873aabb78a72029ShenNoether1-0/+0
2015-08-23Added shen_ed25519_ref to crypto ops subfolder, the point is to directly ↵ShenNoether1-0/+0
have bitmonero's crypto code come from bernstein et al's ref 10 code
2015-08-23use correct unsigned typeroman1-1/+2
2015-08-23removed some gcc warnings. mainly unused variables.roman2-3/+1
2015-08-22chacha8: add a key generation variant that take a pointer and sizemoneromooo-monero1-2/+6
2015-08-09encrypted payment ids are now 64 bit, instead of 256 bitmoneromooo-monero1-0/+5
Pros: - smaller on the blockchain - shorter integrated addresses Cons: - less sparseness - less ability to embed actual information The boolean argument to encrypt payment ids is now gone from the RPC calls, since the decision is made based on the length of the payment id passed.
2015-07-15** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY)NoodleDoodleNoodleDoodleNoodleDoodleNoo2-2/+200
Bockchain: 1. Optim: Multi-thread long-hash computation when encountering groups of blocks. 2. Optim: Cache verified txs and return result from cache instead of re-checking whenever possible. 3. Optim: Preload output-keys when encoutering groups of blocks. Sort by amount and global-index before bulk querying database and multi-thread when possible. 4. Optim: Disable double spend check on block verification, double spend is already detected when trying to add blocks. 5. Optim: Multi-thread signature computation whenever possible. 6. Patch: Disable locking (recursive mutex) on called functions from check_tx_inputs which causes slowdowns (only seems to happen on ubuntu/VMs??? Reason: TBD) 7. Optim: Removed looped full-tx hash computation when retrieving transactions from pool (???). 8. Optim: Cache difficulty/timestamps (735 blocks) for next-difficulty calculations so that only 2 db reads per new block is needed when a new block arrives (instead of 1470 reads). Berkeley-DB: 1. Fix: 32-bit data errors causing wrong output global indices and failure to send blocks to peers (etc). 2. Fix: Unable to pop blocks on reorganize due to transaction errors. 3. Patch: Large number of transaction aborts when running multi-threaded bulk queries. 4. Patch: Insufficient locks error when running full sync. 5. Patch: Incorrect db stats when returning from an immediate exit from "pop block" operation. 6. Optim: Add bulk queries to get output global indices. 7. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 8. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 9. Optim: Added thread-safe buffers used when multi-threading bulk queries. 10. Optim: Added support for nosync/write_nosync options for improved performance (*see --db-sync-mode option for details) 11. Mod: Added checkpoint thread and auto-remove-logs option. 12. *Now usable on 32-bit systems like RPI2. LMDB: 1. Optim: Added custom comparison for 256-bit key tables (minor speed-up, TBD: get actual effect) 2. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 3. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 4. Optim: Added support for sync/writemap options for improved performance (*see --db-sync-mode option for details) 5. Mod: Auto resize to +1GB instead of multiplier x1.5 ETC: 1. Minor optimizations for slow-hash for ARM (RPI2). Incomplete. 2. Fix: 32-bit saturation bug when computing next difficulty on large blocks. [PENDING ISSUES] 1. Berkely db has a very slow "pop-block" operation. This is very noticeable on the RPI2 as it sometimes takes > 10 MINUTES to pop a block during reorganization. This does not happen very often however, most reorgs seem to take a few seconds but it possibly depends on the number of outputs present. TBD. 2. Berkeley db, possible bug "unable to allocate memory". TBD. [NEW OPTIONS] (*Currently all enabled for testing purposes) 1. --fast-block-sync arg=[0:1] (default: 1) a. 0 = Compute long hash per block (may take a while depending on CPU) b. 1 = Skip long-hash and verify blocks based on embedded known good block hashes (faster, minimal CPU dependence) 2. --db-sync-mode arg=[[safe|fast|fastest]:[sync|async]:[nblocks_per_sync]] (default: fastest:async:1000) a. safe = fdatasync/fsync (or equivalent) per stored block. Very slow, but safest option to protect against power-out/crash conditions. b. fast/fastest = Enables asynchronous fdatasync/fsync (or equivalent). Useful for battery operated devices or STABLE systems with UPS and/or systems with battery backed write cache/solid state cache. Fast - Write meta-data but defer data flush. Fastest - Defer meta-data and data flush. Sync - Flush data after nblocks_per_sync and wait. Async - Flush data after nblocks_per_sync but do not wait for the operation to finish. 3. --prep-blocks-threads arg=[n] (default: 4 or system max threads, whichever is lower) Max number of threads to use when computing long-hash in groups. 4. --show-time-stats arg=[0:1] (default: 1) Show benchmark related time stats. 5. --db-auto-remove-logs arg=[0:1] (default: 1) For berkeley-db only. Auto remove logs if enabled. **Note: lmdb and berkeley-db have changes to the tables and are not compatible with official git head version. At the moment, you need a full resync to use this optimized version. [PERFORMANCE COMPARISON] **Some figures are approximations only. Using a baseline machine of an i7-2600K+SSD+(with full pow computation): 1. The optimized lmdb/blockhain core can process blocks up to 585K for ~1.25 hours + download time, so it usually takes 2.5 hours to sync the full chain. 2. The current head with memory can process blocks up to 585K for ~4.2 hours + download time, so it usually takes 5.5 hours to sync the full chain. 3. The current head with lmdb can process blocks up to 585K for ~32 hours + download time and usually takes 36 hours to sync the full chain. Averate procesing times (with full pow computation): lmdb-optimized: 1. tx_ave = 2.5 ms / tx 2. block_ave = 5.87 ms / block memory-official-repo: 1. tx_ave = 8.85 ms / tx 2. block_ave = 19.68 ms / block lmdb-official-repo (0f4a036437fd41a5498ee5e74e2422ea6177aa3e) 1. tx_ave = 47.8 ms / tx 2. block_ave = 64.2 ms / block **Note: The following data denotes processing times only (does not include p2p download time) lmdb-optimized processing times (with full pow computation): 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.25 hours processing time (--db-sync-mode=fastest:async:1000). 2. Laptop, Dual-core / 4-threads U4200 (3Mb) - 4.90 hours processing time (--db-sync-mode=fastest:async:1000). 3. Embedded, Quad-core / 4-threads Z3735F (2x1Mb) - 12.0 hours processing time (--db-sync-mode=fastest:async:1000). lmdb-optimized processing times (with per-block-checkpoint) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 10 minutes processing time (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with full pow computation) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.8 hours processing time (--db-sync-mode=fastest:async:1000). 2. RPI2. Improved from estimated 3 months(???) into 2.5 days (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with per-block-checkpoint) 1. RPI2. 12-15 hours (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000).
2015-04-13disable non-working optimized slow_hash on 32 bit intelJavier Smooth1-1/+1
2015-04-05no newline at end of fileRiccardo Spagni1-1/+1
2015-01-28make fallback compatible with newer slow-hashRiccardo Spagni1-0/+12
2015-01-27added portable slow-hash, updated makefile targets, fixed readmeRiccardo Spagni1-2/+152
2015-01-27fixed sse2 ifdefRiccardo Spagni1-2/+2
2015-01-27remove aes flag, detect no sse2Riccardo Spagni1-0/+2
2015-01-02year updated in licenseRiccardo Spagni26-26/+26
2014-10-23cmake: handle private vs. public headersBen Boeckel1-2/+7
2014-10-23cmake: refactor common code with librariesBen Boeckel1-9/+1
2014-10-23cmake: put each library into its own directoryBen Boeckel1-0/+79
This cleans up the CMake code and shows patterns more easily (to be refactored in the next commit).
2014-10-06capitalize Keccak everywhereDavid G. Andersen1-1/+1
2014-10-06typo fix - cryptonight, not cryptonoteDavid G. Andersen1-1/+1
2014-10-06Fix comment start for two functionsDavid G. Andersen1-2/+2
2014-10-05another typo fixDavid G. Andersen1-1/+1
2014-10-05fix typoDavid G. Andersen1-1/+1
2014-10-05More documentationDavid G. Andersen1-10/+63
2014-10-05initial doxygen commenting of the CryptoNight proof-of-work codeDavid G. Andersen1-1/+85
2014-09-23Moved mnemonics code to src/mnemonicsOran Juice2-3446/+0
2014-09-15More preprocessor fixes for slow-hashZachary Michaels1-3/+3
2014-09-15Correct includes for mingw in slow-hashZachary Michaels1-0/+8
This needs testing
2014-09-15Change Windows include to windowsZachary Michaels1-1/+1
mingw is case sensitive
2014-09-10mmap on FreeBSD doesn't have MAP_HUGETLBfluffypony1-1/+1
2014-09-10Include sys/time.h on BSDfluffypony1-0/+2
2014-09-10replace ftime with gettimeofday on FreeBSD because lcompat is stupidfluffypony1-0/+28
2014-09-09more FreeBSD fixesfluffypony1-2/+7
2014-09-09malloc.h reference fixed for FreeBSDfluffypony1-2/+2
2014-09-09FreeBSD alloca.h reference fixedfluffypony2-2/+12
2014-09-06Fix tree-hash cnt n^2. Asserts, comment. Squash2rfree2monero1-6/+48
2014-09-02fixed OS X malloc.h referencefluffypony1-1/+4
2014-07-23License updated to BSD 3-clausefluffypony26-57/+750
2014-07-01Remove unused array in cn_slow_hashZachary Michaels1-1/+0
2014-06-19Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-0/+5
1. Fix for Mac OSX compilation errors.
2014-06-16Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-1/+8
1. Added multiplication support in 32-bit mode
2014-06-16Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-110/+288
1. Added huge pages support and optimized scratchpad twiddling. (credits to dga). 2. Added aes-ni key expansion support. 3. Minor speedup to scratchpad initialization/finalization.
2014-06-16Revert "Update slow-hash.c"NoodleDoodleNoodleDoodleNoodleDoodleNoo1-404/+118
This reverts commit 37c5f393f1693da23416a2a294752f0c3e997c31.
2014-06-16Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-118/+404
1. Added huge pages support and optimized scratchpad twiddling. (credits to dga). 2. Added aes-ni key expansion support. 3. Minor speedup to scratchpad initialization/finalization.
2014-06-12stupid signed arithmetic.Thomas Winget1-6/+3
2014-06-12more pointer-based derpThomas Winget2-3/+13
2014-06-12fixed some pointer- and loop-based derpsThomas Winget1-1/+1
2014-06-12builds, but doesn't link. other than that, electrum-style recovery ↵Thomas Winget3-11/+26
implemented (but not tested\!)
2014-06-12missing '.at' on two map calls. built on some machines, very strange...Thomas Winget1-2/+2
2014-06-12revert 'dirty hack' change to crypto.h. need a better way for sure.Thomas Winget1-4/+1
2014-06-12compile issues, resolve later. commiting because switching machinestom3-2/+83
2014-06-12most functions prototyped/modified for wallet recoveryThomas Winget3-0/+3311
2014-05-250.8.8updatemydesktop2-13/+11
2014-05-21Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-117/+223
1. Added AES-NI support for modern processors.
2014-05-17Create aesb.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-0/+177
2014-05-17Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-14/+18
1. Various optimizations for faster hashing performance.
2014-05-17Update oaes_lib.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-24/+0
1. Moved structs oaes_ctx and oaes_key into oeas_lib header.
2014-05-17Update oaes_lib.hNoodleDoodleNoodleDoodleNoodleDoodleNoo1-0/+26
1. Moved structs oaes_ctx and oaes_key into oeas_lib header.
2014-05-17Update oaes_config.hNoodleDoodleNoodleDoodleNoodleDoodleNoo1-3/+3
1. Disabled OAES_DEBUG flag
2014-05-07Update slow-hash.cNoodleDoodleNoodleDoodleNoodleDoodleNoo1-6/+4
Fixed scratchpad initialization/finalization for faster looping.
2014-04-30various fixes to allow mac osx compilationmydesktop1-0/+1
2014-03-03moved all stuff to githubAntonio Juarez37-440/+6347
2013-11-15crypto libamjuarez11-0/+4627