Switch to personal project -> update copyright
This commit is contained in:
parent
c4b3d49e69
commit
5dc97927c5
|
@ -1,86 +0,0 @@
|
|||
version: '{build}'
|
||||
|
||||
cache:
|
||||
- x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z -> .appveyor.yml
|
||||
- i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z -> .appveyor.yml
|
||||
- Nim -> .appveyor.yml
|
||||
|
||||
matrix:
|
||||
# We always want 32 and 64-bit compilation
|
||||
fast_finish: false
|
||||
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
install:
|
||||
- setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
- IF "%PLATFORM%" == "x86" (
|
||||
SET "MINGW_ARCHIVE=i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z" &
|
||||
SET "MINGW_URL=https://sourceforge.net/projects/mingw-w64/files/Toolchains%%20targetting%%20Win32/Personal%%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z" &
|
||||
SET "MINGW_DIR=mingw32"
|
||||
) ELSE (
|
||||
IF "%PLATFORM%" == "x64" (
|
||||
SET "MINGW_ARCHIVE=x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z" &
|
||||
SET "MINGW_URL=https://sourceforge.net/projects/mingw-w64/files/Toolchains%%20targetting%%20Win64/Personal%%20Builds/mingw-builds/4.9.2/threads-win32/seh/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z" &
|
||||
SET "MINGW_DIR=mingw64"
|
||||
) else (
|
||||
echo "Unknown platform"
|
||||
)
|
||||
)
|
||||
|
||||
- SET PATH=%CD%\%MINGW_DIR%\bin;%CD%\Nim\bin;%PATH%
|
||||
|
||||
# Unpack mingw
|
||||
- IF NOT EXIST "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
|
||||
- 7z x -y "%MINGW_ARCHIVE%" > nul
|
||||
|
||||
# build nim from our own branch - this to avoid the day-to-day churn and
|
||||
# regressions of the fast-paced Nim development while maintaining the
|
||||
# flexibility to apply patches
|
||||
- SET "NEED_REBUILD="
|
||||
|
||||
- IF NOT EXIST "Nim\\.git\\" (
|
||||
git clone https://github.com/status-im/Nim.git
|
||||
) ELSE (
|
||||
( cd Nim ) &
|
||||
( git pull ) &
|
||||
( cd .. )
|
||||
)
|
||||
|
||||
# Rebuild Nim if HEAD has moved or if we don't yet have a cached version
|
||||
- IF NOT EXIST "Nim\\ver.txt" (
|
||||
SET NEED_REBUILD=1
|
||||
) ELSE (
|
||||
( CD Nim ) &
|
||||
( git rev-parse HEAD > ..\\cur_ver.txt ) &
|
||||
( fc ver.txt ..\\cur_ver.txt || SET NEED_REBUILD=1 ) &
|
||||
( cd .. )
|
||||
)
|
||||
|
||||
- IF NOT EXIST "Nim\\bin\\nim.exe" SET NEED_REBUILD=1
|
||||
- IF NOT EXIST "Nim\\bin\\nimble.exe" SET NEED_REBUILD=1
|
||||
|
||||
# after building nim, wipe csources to save on cache space
|
||||
- IF DEFINED NEED_REBUILD (
|
||||
cd Nim &
|
||||
( IF EXIST "csources" rmdir /s /q csources ) &
|
||||
git clone --depth 1 https://github.com/nim-lang/csources &
|
||||
cd csources &
|
||||
( IF "%PLATFORM%" == "x64" ( build64.bat ) else ( build.bat ) ) &
|
||||
cd .. &
|
||||
bin\nim c koch &
|
||||
koch boot -d:release &
|
||||
koch nimble &
|
||||
git rev-parse HEAD > ver.txt &
|
||||
rmdir /s /q csources
|
||||
)
|
||||
|
||||
build_script:
|
||||
- cd C:\projects\%APPVEYOR_PROJECT_SLUG%
|
||||
- nimble install -y
|
||||
test_script:
|
||||
- nimble test
|
||||
|
||||
deploy: off
|
39
.travis.yml
39
.travis.yml
|
@ -1,39 +0,0 @@
|
|||
language: c # or other C/C++ variants
|
||||
|
||||
sudo: false
|
||||
|
||||
# https://docs.travis-ci.com/user/caching/
|
||||
#
|
||||
# Caching the whole nim folder is better than relying on ccache - this way, we
|
||||
# skip the expensive bootstrap process and linking
|
||||
cache:
|
||||
directories:
|
||||
- nim
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
install:
|
||||
# build nim from our own branch - this to avoid the day-to-day churn and
|
||||
# regressions of the fast-paced Nim development while maintaining the
|
||||
# flexibility to apply patches
|
||||
#
|
||||
# check version of remote branch
|
||||
- "export NIMVER=$(git ls-remote https://github.com/status-im/nim.git HEAD | cut -f 1)"
|
||||
|
||||
# after building nim, wipe csources to save on cache space
|
||||
- "{ [ -f nim/$NIMVER/bin/nim ] && [ -f nim/$NIMVER/bin/nimble ] ; } ||
|
||||
{ rm -rf nim ;
|
||||
mkdir -p nim ;
|
||||
git clone --depth=1 https://github.com/status-im/nim.git nim/$NIMVER ;
|
||||
cd nim/$NIMVER ;
|
||||
sh build_all.sh ;
|
||||
rm -rf csources ;
|
||||
cd ../.. ;
|
||||
}"
|
||||
- "export PATH=$PWD/nim/$NIMVER/bin:$PATH"
|
||||
|
||||
script:
|
||||
- nimble install -y
|
||||
- nimble test
|
|
@ -1,5 +1,6 @@
|
|||
constantine is licensed under the Apache License version 2
|
||||
Copyright (c) 2018 Status Research & Development GmbH
|
||||
Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
-----------------------------------------------------
|
||||
|
||||
Apache License
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
constantine is licensed under the MIT License
|
||||
Copyright (c) 2018 Status Research & Development GmbH
|
||||
Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
-----------------------------------------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Status Research & Development GmbH
|
||||
Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
# Constantine - Constant time finitie field primitives for Elliptic Curve Cryptography
|
||||
# Constantine - Constant time finite field primitives for Elliptic Curve Cryptography
|
||||
|
||||
[![Build Status (Travis)](https://img.shields.io/travis/status-im/nim-constantine/master.svg?label=Linux%20/%20macOS "Linux/macOS build status (Travis)")](https://travis-ci.org/status-im/nim-constantine)
|
||||
[![Windows build status (Appveyor)](https://img.shields.io/appveyor/ci/nimbus/nim-constantine/master.svg?label=Windows "Windows build status (Appveyor)")](https://ci.appveyor.com/project/nimbus/nim-constantine)
|
||||
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
![Stability: experimental](https://img.shields.io/badge/stability-experimental-orange.svg)
|
||||
|
||||
This library provides constant time finite field primitives for implementation of elliptic curve cryptography.
|
||||
|
||||
Warning ⚠️: The library is in development state.
|
||||
Warning ⚠️: The library is in development state and cannot be used at the moment
|
||||
except as a showcase or to start a discussion on modular big integers internals.
|
||||
|
||||
## Installation
|
||||
|
||||
You can install the developement version of the library through nimble with the following command
|
||||
```
|
||||
nimble install https://github.com/status-im/nim-constantine@#master
|
||||
nimble install https://github.com/mratsim/constantine@#master
|
||||
```
|
||||
|
||||
## License
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -82,8 +83,8 @@ template shiftAddImpl(a: var Fp, c: Word) =
|
|||
var q: Word
|
||||
|
||||
# (hi, lo) = a * 2^63 + c
|
||||
let hi = a[0] shr 1 # 64 - 63 = 1
|
||||
let lo = a[0] shl WordBitSize or c # Assumes most-significant bit in c is not set
|
||||
let hi = a[0] shr 1 # 64 - 63 = 1
|
||||
let lo = (a[0] shl WordBitSize) or c # Assumes most-significant bit in c is not set
|
||||
unsafeDiv2n1n(q, a[0], hi, lo, Fp.P.limbs[0]) # (hi, lo) mod P
|
||||
|
||||
else:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -228,10 +229,10 @@ func hexToPaddedByteArray(hexStr: string, output: var openArray[byte], order: st
|
|||
let size = hexStr.len - skip
|
||||
|
||||
doAssert size <= maxStrSize
|
||||
|
||||
|
||||
if size < maxStrSize:
|
||||
# include extra byte if odd length
|
||||
dstIdx = output.len - (size + 1) div 2
|
||||
dstIdx = output.len - (size + 1) div 2
|
||||
# start with shl of 4 if length is even
|
||||
shift = 4 - size mod 2 * 4
|
||||
|
||||
|
@ -280,7 +281,7 @@ func fromHex*(T: type BigInt, s: string): T =
|
|||
|
||||
# 2. Convert canonical uint to Big Int
|
||||
result = parseRawUint(bytes, T.bits, littleEndian)
|
||||
|
||||
|
||||
func dumpHex*(big: BigInt, order: static Endianness = bigEndian): string =
|
||||
## Stringify an int to hex.
|
||||
## Note. Leading zeros are not removed.
|
||||
|
@ -305,4 +306,3 @@ func dumpHex*(big: BigInt, order: static Endianness = bigEndian): string =
|
|||
|
||||
# 2 Convert canonical uint to hex
|
||||
result = bytes.toHex(order)
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Constantine
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Constantine
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# constantine
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# Constantine
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
|
Loading…
Reference in New Issue