Commit Graph

121 Commits

Author SHA1 Message Date
moneromooo-monero
7193b89fe5 Scrub keys from memory just before scope end.
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-16 15:40:33 -07:00
Riccardo Spagni
6c0953b15a
Merge pull request #2860
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero)
7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero)
54950829 use memwipe in a few relevant places (moneromooo-monero)
000666ff add a memwipe function (moneromooo-monero)
2017-12-16 23:19:27 +02:00
moneromooo-monero
ada4291469
add a version of ge_double_scalarmult_precomp_vartime with A precomp 2017-12-07 19:23:10 +00:00
luigi1111
7ff07928ad
sc_mul and sc_muladd 2017-12-07 19:23:05 +00:00
moneromooo-monero
549508296d
use memwipe in a few relevant places 2017-11-27 22:15:37 +00:00
Riccardo Spagni
5c2dfe157b
Merge pull request #2771
e3e838d0 kaccak: remove unused return value (moneromooo-monero)
4877aca2 keccak: some paranoid "can't happen" checks (moneromooo-monero)
2017-11-15 11:22:56 +02:00
Pavel Maryanov
a17efcb039
make this build on SunOS/Solaris 2017-11-14 17:03:48 +00:00
moneromooo-monero
e3e838d0cf
kaccak: remove unused return value 2017-11-11 11:20:48 +00:00
moneromooo-monero
4877aca2b6
keccak: some paranoid "can't happen" checks 2017-11-07 14:02:37 +00:00
Riccardo Spagni
1740f0a13e
Merge pull request #2583
27fdaaa4 Fix building with -DARCH=default -DNO_AES=ON (moneromooo-monero)
2017-10-15 18:37:14 +02:00
kenshi84
53ad5a0f42
Subaddresses 2017-10-07 13:06:21 +09:00
moneromooo-monero
27fdaaa409
Fix building with -DARCH=default -DNO_AES=ON 2017-10-06 08:47:03 +01:00
moneromooo-monero
5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
moneromooo-monero
b5345ef4f0
crypto: use malloc instead of alloca 2017-08-23 13:38:03 +01:00
stoffu
8da82256d4
crypto: moved boost::lock_guard into a smaller scope 2017-06-22 18:11:15 +09:00
stoffu
c9e0e944e9
Signature proving payment to destination by only revealing key derivation, not the actual tx secret key 2017-06-22 18:11:13 +09:00
Howard Chu
1dd524151d
Fix #1991 asm multiply again
Tweak temp variables and constraints. Was working before if not inlined
but newer gcc tends to inline it.
2017-06-08 21:46:40 +01:00
Gentian
4b932ff314 changed crypto to cncrypto so it generated libcncrypto
fix a cmakelist
2017-05-23 07:45:40 -04:00
hyc
a467321800 Clean up ARMv8-a aes_expand_key()
The inline asm was lying about its parameters
2017-04-12 23:53:08 +01:00
Jaquee
f5bd346573
IOS CMAKE build settings 2017-04-03 18:38:50 +02:00
Guillaume LE VAILLANT
93b32892f7 Silence warning about possibly uninitialized pointer 2017-03-25 13:53:14 +01:00
darentuzi
585c917691 Specify "524,288" iterations instead of "500,000"
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-03-14 16:39:44 +02:00
Riccardo Spagni
c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
NanoAkron
67693415ff
Fix compiler error about nested externs in slow_hash.c by moving declarations 2017-02-13 22:35:43 +00:00
Riccardo Spagni
2a996f492f
Merge pull request #1510
80abc3bc Build wallet with Android NDK (MoroccanMalinois)
2017-01-08 16:40:02 -08:00
MoroccanMalinois
80abc3bc4a Build wallet with Android NDK 2017-01-05 01:11:05 +00:00
fireice-uk
474c249c90 cleaner log calc algorithm 2016-12-22 20:29:41 +00:00
Antonio Huete Jimenez
b00da61eab Preliminary support for DragonFly BSD
- It builds but no further testing has been done.
2016-12-15 02:27:53 -08:00
moneromooo-monero
f6fcf0ef26
oaes_lib: fix a leak on OOM error path
found by coverity
2016-12-10 12:51:20 +00:00
moneromooo-monero
c80f4d416d
wallet: fix output collision detection for view wallets
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-11-07 18:59:30 +00:00
NanoAkron
f71b06770b
Changed to ..._HASHBITS everywhere for consistency 2016-10-29 14:59:06 +01:00
Randi Joseph
9e54616924 Dropped "bit" from bitmonero. 2016-09-26 17:22:30 -04:00
redfish
e1c7af35d4 cmake: transitive deps and remove deprecated LINK_*
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-18 02:56:26 -04:00
redfish
54010b97b4 crypto: armv7: slow-hash: remove redundant source include
aesb.c is already present in libcrypto as a standalone object.
Tested: builds and runs fine on armv7, static and dynamic.
2016-09-18 02:56:26 -04:00
Howard Chu
69b59186f3
Add ARMv8-A AES support
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-16 01:45:49 +01:00
redfish
24d93370ad crypto,cmake: enable ASM mul impl on ARM; add cmake opt
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-09-04 06:46:35 +00:00
moneromooo-monero
d4b62a1e29
rct amount key modified as per luigi1111's recommendations
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-28 21:30:19 +01:00
moneromooo-monero
e70e8a69f4
crypto: error out where appropriate 2016-08-28 21:28:29 +01:00
moneromooo-monero
9b1afe5f2d
ringct: import of Shen Noether's ring confidential transactions 2016-08-28 21:26:54 +01:00
Riccardo Spagni
ba61f37f9c
Merge pull request #846
de030d9 fix: error: -Werror=misleading-indentation (moneroexample)
c2d7300 contrib: epee: add exception spec to throwing destructors (redfish)
6898741 src: p2p: add exception spec to throwing destructors (redfish)
21dbc95 crypto: slow-hash: fix misleading indent (redfish)
70f3634 crypto: slow-hash: remove unused hash list for ARM (redfish)
1a7772f crypto: oaes_lib: remove unused _NR array (redfish)
6462a3a crypto: fix compile error: use named type in sizeof (redfish)
2016-06-19 21:25:52 +02:00
redfish
95be58ef0e crypto: slow-hash: disable mul implemented in asm for ARM
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-25 15:53:29 -04:00
redfish
21dbc95b47 crypto: slow-hash: fix misleading indent
GCC warned about this one.
2016-05-18 01:02:17 -04:00
redfish
70f363401b crypto: slow-hash: remove unused hash list for ARM
This list is already defined within the function. The
removed definition was shadowed.
2016-05-18 01:02:13 -04:00
redfish
1a7772fbae crypto: oaes_lib: remove unused _NR array 2016-05-18 01:02:07 -04:00
redfish
6462a3a6db crypto: fix compile error: use named type in sizeof
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-18 01:01:58 -04:00
moneromooo-monero
d539be3359
crypto: make clear generate_random_bytes is not thread safe
And add a thread safe version to encourage proper use
2016-05-15 00:05:59 +01:00
moneromooo-monero
31587bdd15
random: call abort(3) instead of assert in must_succeed macro
Avoids silent use of bad RNG in release builds, in case those
calls might actually fail.

Reported by smooth.
2016-04-24 12:26:56 +01:00
Riccardo Spagni
0a4dd68c17 minor tweaks, add readme for crypto_ops_builder 2016-03-11 22:48:46 +02:00
Howard Chu
b937a2c915 Use boost::thread instead of std::thread
and all other associated IPC
2016-03-11 15:09:50 +00:00
moneromooo-monero
c7e6b77395
crypto: only check MONERO_USE_SOFTWARE_AES once 2016-02-09 09:38:17 +00:00