Skip to content

Commit

Permalink
Add licence information to sections based on third-party code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Nov 29, 2023
1 parent 3cf4d6a commit 61ab03f
Show file tree
Hide file tree
Showing 19 changed files with 252 additions and 18 deletions.
2 changes: 2 additions & 0 deletions soup/Box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace soup
* I use a 4x4 matrix to store the rotation and centerpoint translation, and a vector for the Extents.
* I just chose to use a 4x4 matrix for simplicity so I could use the matrix class.
* An alternative to storing extents and a centerpoint is storing the minimum corner and maximum corner, so I have a set function that converts from this format.
*
* (I've reached out on 1 Feb 2022 asking about the licence/legal terms, but did not receive a response.)
*/

#pragma pack(push, 1)
Expand Down
3 changes: 2 additions & 1 deletion soup/Curve25519.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

namespace soup
{
// Based on https://www.dlbeer.co.nz/oss/c25519.html and https://github.com/DavyLandman/compact25519
// Original source: https://www.dlbeer.co.nz/oss/c25519.html and https://github.com/DavyLandman/compact25519
// Original licence: Dedicated to the public domain.

struct Curve25519
{
Expand Down
22 changes: 21 additions & 1 deletion soup/QrCode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@

namespace soup
{
// Based on https://www.nayuki.io/page/qr-code-generator-library
/*
* Original source: https://www.nayuki.io/page/qr-code-generator-library
* Original licence follows.
*
* Copyright (c) Project Nayuki.
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - The Software is provided "as is", without warranty of any kind, express or
* implied, including but not limited to the warranties of merchantability,
* fitness for a particular purpose and noninfringement. In no event shall the
* authors or copyright holders be liable for any claim, damages or other
* liability, whether in an action of contract, tort or otherwise, arising from,
* out of or in connection with the Software or the use or other dealings in the
* Software.
*/

/*
* A QR Code symbol, which is a type of two-dimension barcode.
Expand Down
25 changes: 25 additions & 0 deletions soup/SegWitAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@
#include "ripemd160.hpp"
#include "sha256.hpp"

/*
Original source: https://github.com/sipa/bech32
Original licence follows.
Copyright (c) 2017, 2021 Pieter Wuille
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

namespace soup
{
std::string SegWitAddress::encode() const
Expand Down
2 changes: 0 additions & 2 deletions soup/SegWitAddress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

namespace soup
{
// Adapted from https://github.com/sipa/bech32

struct SegWitAddress
{
enum Network : uint8_t
Expand Down
21 changes: 20 additions & 1 deletion soup/TinyPngOut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,26 @@

namespace soup
{
// Based on https://www.nayuki.io/page/tiny-png-output
/*
* Original source: https://www.nayuki.io/page/tiny-png-output
* Original licence follows.
*
* Copyright (c) 2018 Project Nayuki
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program (see COPYING.txt and COPYING.LESSER.txt).
* If not, see <http://www.gnu.org/licenses/>.
*/

/*
* Takes image pixel data in raw RGB8.8.8 format and writes a PNG file to a byte output stream.
Expand Down
25 changes: 25 additions & 0 deletions soup/aes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@
#include "Endian.hpp"
#include "plusaes.hpp"

/*
Original source: https://github.com/SergeyBel/AES
Original licence follows.
Copyright (c) 2019 SergeyBel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

namespace soup
{
static constexpr int Nb = 4;
Expand Down
2 changes: 0 additions & 2 deletions soup/aes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

namespace soup
{
// Adapted from https://github.com/SergeyBel/AES

class aes
{
public:
Expand Down
26 changes: 26 additions & 0 deletions soup/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@
#include "alpha2decodetbl.hpp"
#include "Exception.hpp"

/*
Original source: https://github.com/bitcoin/bitcoin/blob/master/src/base58.cpp
Original licence follows.
Copyright (c) 2009-2023 The Bitcoin Core developers
Copyright (c) 2009-2023 Bitcoin Developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

namespace soup
{
std::string base58::decode(const std::string& in)
Expand Down
2 changes: 0 additions & 2 deletions soup/base58.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace soup
{
// Adapted from https://github.com/bitcoin/bitcoin/blob/master/src/base58.cpp

struct base58
{
[[nodiscard]] static std::string decode(const std::string& in);
Expand Down
26 changes: 26 additions & 0 deletions soup/base64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
#include "base64.hpp"

/*
Original source: https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594
Original licence follows.
Copyright (c) 2016 tomykaira
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

namespace soup
{
static constexpr char table_encode_base64[] = {
Expand Down
2 changes: 0 additions & 2 deletions soup/base64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

namespace soup
{
// Adapted from https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594

struct base64
{
[[nodiscard]] static std::string encode(const char* data, const bool pad = true) noexcept;
Expand Down
25 changes: 25 additions & 0 deletions soup/bech32.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#include "bech32.hpp"

/*
Original source: https://github.com/sipa/bech32
Original licence follows.
Copyright (c) 2017, 2021 Pieter Wuille
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

namespace soup
{
/** The Bech32 character set for encoding. */
Expand Down
2 changes: 0 additions & 2 deletions soup/bech32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

namespace soup
{
// Adapted from https://github.com/sipa/bech32

struct bech32
{
[[nodiscard]] static std::string encode(const std::string& hrp, const std::vector<uint8_t>& values);
Expand Down
25 changes: 25 additions & 0 deletions soup/deflate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
#include "crc32.hpp"
#include "Endian.hpp"

/*
Original source: https://github.com/Artexety/inflatecpp
Original licence follows.
Copyright (c) 2020 Artexety
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#if SOUP_BITS == 64
#define X64BIT_SHIFTER
#endif
Expand Down
28 changes: 28 additions & 0 deletions soup/ripemd160.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
#include <cstdint>
#include <cstring>

/*
Original source: https://homes.esat.kuleuven.be/~bosselae/ripemd160.html
Original licence follows.
Copyright (c) 1996 Katholieke Universiteit Leuven
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(They also state that this is not covered by any patents, so, cool!)
*/

namespace soup
{
/* macro definitions */
Expand Down
2 changes: 0 additions & 2 deletions soup/ripemd160.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@

namespace soup
{
// Adapted from https://homes.esat.kuleuven.be/~bosselae/ripemd160.html

[[nodiscard]] std::string ripemd160(const std::string& in);
}
3 changes: 2 additions & 1 deletion soup/sha1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

namespace soup
{
// Adapted from https://github.com/vog/sha1
// Original source: https://github.com/vog/sha1
// Original licence: Dedicated to the public domain.

static constexpr auto BLOCK_INTS = sha1::BLOCK_BYTES / sizeof(uint32_t);

Expand Down
Loading

0 comments on commit 61ab03f

Please sign in to comment.