Commit Graph

28 Commits

Author SHA1 Message Date
2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
c89ae53677 msvc: remove warning disables which no longer fire 2021-07-17 18:24:36 -07:00
51cdc5542c licensing: fix license info for Crypto/{bn,ec}
This code was part of Dolphin's relicensing from v2 to v2+ a while back,
we just never updated these copyright headers. I double-checked that
segher gave us permission to relicense this code to v2+ on 2015-05-16.
2021-07-05 04:35:56 +02:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
2137fb7813 Externals: Add zstd
I had to rename Source/Common/Compiler.h because the VS build
confuses it with Externals/zstd/lib/common/compiler.h otherwise.
2020-05-13 20:53:10 +02:00
cb168f22d6 Replace custom UNUSED macro with [[maybe_unused]] 2019-05-04 23:04:18 +02:00
d8f6d60189 Compiler: Rename UNUSED macro to DOLPHIN_UNUSED
UNUSED is quite a generic macro name and has potential to clash with
other libraries, so rename it to DOLPHIN_UNUSED to prevent that, as well
as make its naming consistent with the force inline macro
2018-06-09 12:20:29 -04:00
03414e8e84 Common: Add header for compiler-specifics
Instead of globbing things under an ambiguous Common.h header, move
compiler-specifics over to Compiler.h. This gives us a dedicated home
for anything related to compilers that we want to make functional across
all compilers that we support.

This moves us a little closer to eliminating Common.h entirely.
2018-06-09 12:10:05 -04:00
fff1db9730 Common: Add Random utilities
This makes it easier to generate random numbers or fill a buffer with
random data in a cryptographically secure way.

This also replaces existing usages of RNG functions in the codebase:

* <random> is pretty hard to use correctly, and std::random_device does
  not give enough guarantees about its results (it's
  implementation-defined, non cryptographically secure and could be
  deterministic on some platforms).
  Doing things correctly is error prone and verbose.

* rand() is terrible and should not be used especially in crypto code.
2018-05-31 17:54:43 +02:00
bea1e38c67 Move ECCSignature to Common::ec and give it a less confusing name 2018-05-27 14:01:38 +02:00
cec7fded60 IOSC: Implement VerifyPublicKeySign for ECC 2018-05-20 20:04:53 +02:00
355b1b5d5b ec: Improve readability and clarity
- Move all of the ec functions into the Common::ec namespace.

- Give the public functions better names and some usage information.

- Move all of the "elt" related functions into an "elt" class including
  all of the arithmetic operations, so that the logic becomes clearer
  and feels less like assembly.

  This also makes it much more obvious what the parameters are, instead
  of only using unsigned char* (which doesn't tell anything about what
  the pointer is used for or the size).

- Similarly, add a new "Point" class and move point functions there.
  Overload the arithmetic operators to make calculations easier to read
2018-05-20 19:59:26 +02:00
e83591f188 ec: Avoid exposing internal function 2018-05-20 19:59:26 +02:00
4f9dd7277b msvc: disable unused symbol warning in Core/Common/Crypto/ec.cpp 2017-06-07 18:44:03 -07:00
9c31d6f5c5 IOS/ES: Handle personalised tickets properly
IOS unpersonalises device-specific ("personalised") tickets prior to
storing them on the NAND.
2017-03-11 21:14:26 +01:00
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
3e283ea9f1 More asterisks 2016-01-21 21:16:51 +01:00
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
46057db37d Fix build failing when disabling precompiled headers. 2014-09-19 18:17:51 -04:00
fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
0ccee6c87b Fix warnings unearthed by #579 2014-07-13 02:16:51 +02:00
31cfc73a09 Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00
d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
46e7c0657f Crypto: small cleanup 2014-02-28 12:43:22 +01:00
2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
3fd87a7636 Second and final pass of clearing out tabs. 2014-02-17 02:19:41 -05:00
34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00