mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 15:08:12 +00:00
ci: enable editorconfig checks, fix whitespace issues
This commit is contained in:
parent
473fb1a3a6
commit
50fdd183c2
5
Makefile
5
Makefile
@ -9,7 +9,7 @@ PY_FILES = $(shell find . -type f -name '*.py' | grep -f ./tools/style.py.incl
|
|||||||
C_FILES = $(shell find . -type f -name '*.[ch]' | grep -f ./tools/style.c.include | grep -v -f ./tools/style.c.exclude )
|
C_FILES = $(shell find . -type f -name '*.[ch]' | grep -f ./tools/style.c.include | grep -v -f ./tools/style.c.exclude )
|
||||||
|
|
||||||
|
|
||||||
style_check: pystyle_check cstyle_check changelog_check yaml_check ## run all style checks (C+Py)
|
style_check: pystyle_check cstyle_check changelog_check yaml_check editor_check ## run all style checks (C+Py)
|
||||||
|
|
||||||
style: pystyle cstyle changelog ## apply all code styles (C+Py)
|
style: pystyle cstyle changelog ## apply all code styles (C+Py)
|
||||||
|
|
||||||
@ -45,6 +45,9 @@ changelog_check: ## check changelog format
|
|||||||
yaml_check: ## check yaml formatting
|
yaml_check: ## check yaml formatting
|
||||||
yamllint .
|
yamllint .
|
||||||
|
|
||||||
|
editor_check: ## check editorconfig formatting
|
||||||
|
editorconfig-checker -exclude '.*\.(so|dat|toif|der)'
|
||||||
|
|
||||||
changelog: ## fill out issue links in changelog
|
changelog: ## fill out issue links in changelog
|
||||||
./tools/linkify-changelogs.py
|
./tools/linkify-changelogs.py
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ $# -ne 2 ]
|
if [ $# -ne 2 ]
|
||||||
then
|
then
|
||||||
echo "Usage: $0 commit_id [start|stop]"
|
echo "Usage: $0 commit_id [start|stop]"
|
||||||
|
@ -12,22 +12,22 @@ Servo servo_left;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// Starting the serial console
|
// Starting the serial console
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
// Attaching both servos
|
// Attaching both servos
|
||||||
servo_right.attach(7);
|
servo_right.attach(7);
|
||||||
servo_left.attach(8);
|
servo_left.attach(8);
|
||||||
|
|
||||||
// Setting them un unpressed position
|
// Setting them un unpressed position
|
||||||
servo_right.write(right_unpressed);
|
servo_right.write(right_unpressed);
|
||||||
servo_left.write(left_unpressed);
|
servo_left.write(left_unpressed);
|
||||||
Serial.println("Ready for commands, press my buttons!");
|
Serial.println("Ready for commands, press my buttons!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
if(Serial.available()){
|
if(Serial.available()){
|
||||||
command = Serial.readStringUntil('\n');
|
command = Serial.readStringUntil('\n');
|
||||||
|
|
||||||
if(command.equals("right press")){
|
if(command.equals("right press")){
|
||||||
Serial.println("Pressing right button.");
|
Serial.println("Pressing right button.");
|
||||||
servo_right.write(right_pressed);
|
servo_right.write(right_pressed);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# 3D print model for tpmb
|
# 3D print model for tpmb
|
||||||
|
|
||||||
This is pretty easy to print. First open ```base.scad``` with OpenSCAD and
|
This is pretty easy to print. First open ```base.scad``` with OpenSCAD and
|
||||||
export your ```.stl``` file with it.
|
export your ```.stl``` file with it.
|
||||||
|
|
||||||
Open it with your slider, we are using
|
Open it with your slider, we are using
|
||||||
Original Priska i3 MK3 to print our models. 0.15mm quality setting with standard
|
Original Prusa i3 MK3 to print our models. 0.15mm quality setting with standard
|
||||||
PLA works fine for us.
|
PLA works fine for us.
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
// Horizontal wall
|
// Horizontal wall
|
||||||
difference() {
|
difference() {
|
||||||
// Creating the base
|
// Creating the base
|
||||||
cube([100,80,7]);
|
cube([100,80,7]);
|
||||||
|
|
||||||
// Cutting a hole for trezor to sit in
|
// Cutting a hole for trezor to sit in
|
||||||
translate([0,25,2])
|
translate([0,25,2])
|
||||||
cube([65,30,10]);
|
cube([65,30,10]);
|
||||||
@ -17,13 +17,13 @@ difference() {
|
|||||||
// Cutting an opening for stuck trezor
|
// Cutting an opening for stuck trezor
|
||||||
translate([0,26,-2])
|
translate([0,26,-2])
|
||||||
cube([10,28,12]);
|
cube([10,28,12]);
|
||||||
|
|
||||||
// Creating opening for right servo
|
// Creating opening for right servo
|
||||||
translate([0,7-3,12])
|
translate([0,7-3,12])
|
||||||
cube([10,23,92]);
|
cube([10,23,92]);
|
||||||
translate([0,0,40])
|
translate([0,0,40])
|
||||||
cube([10,23,92]);
|
cube([10,23,92]);
|
||||||
|
|
||||||
// Creating opening for left servo
|
// Creating opening for left servo
|
||||||
translate([0,50+3,12])
|
translate([0,50+3,12])
|
||||||
cube([10,23,92]);
|
cube([10,23,92]);
|
||||||
|
@ -17,6 +17,11 @@ gen prebuild:
|
|||||||
script:
|
script:
|
||||||
- nix-shell --run "poetry run make gen_check"
|
- nix-shell --run "poetry run make gen_check"
|
||||||
|
|
||||||
|
editor prebuild:
|
||||||
|
stage: prebuild
|
||||||
|
script:
|
||||||
|
- nix-shell --run "make editor_check"
|
||||||
|
|
||||||
yaml prebuild:
|
yaml prebuild:
|
||||||
stage: prebuild
|
stage: prebuild
|
||||||
script:
|
script:
|
||||||
|
@ -37,6 +37,7 @@ stdenv.mkDerivation ({
|
|||||||
bash
|
bash
|
||||||
check
|
check
|
||||||
clang-tools
|
clang-tools
|
||||||
|
editorconfig-checker
|
||||||
gcc
|
gcc
|
||||||
gcc-arm-embedded
|
gcc-arm-embedded
|
||||||
git
|
git
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Trezor Common
|
# Trezor Common
|
||||||
|
|
||||||
This project contains files shared among Trezor projects. All changes are happening inside the [Trezor Firmware repository](https://github.com/trezor/trezor-firmware).
|
This project contains files shared among Trezor projects. All changes are happening inside the [Trezor Firmware repository](https://github.com/trezor/trezor-firmware).
|
||||||
|
|
||||||
We also export this project to the [trezor-common repository](https://github.com/trezor/trezor-common) as a read-only copy so third parties may depend on that instead of the whole monorepo. It is meant to be used as a submodule using:
|
We also export this project to the [trezor-common repository](https://github.com/trezor/trezor-common) as a read-only copy so third parties may depend on that instead of the whole monorepo. It is meant to be used as a submodule using:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -127,7 +127,7 @@ message CardanoSignTx {
|
|||||||
optional bytes prev_hash = 2; // hash of previous transaction output to spend by this input
|
optional bytes prev_hash = 2; // hash of previous transaction output to spend by this input
|
||||||
optional uint32 prev_index = 3; // index of previous output to spend
|
optional uint32 prev_index = 3; // index of previous output to spend
|
||||||
// left as a comment so we know to skip the id 4 in the future
|
// left as a comment so we know to skip the id 4 in the future
|
||||||
// optional uint32 type = 4;
|
// optional uint32 type = 4;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Structure representing cardano transaction output
|
* Structure representing cardano transaction output
|
||||||
|
@ -61,13 +61,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Remove ETP, GIN, PTC, ZEL support.
|
- Remove ETP, GIN, PTC, ZEL support.
|
||||||
- Drop support for signing Zcash v3 transactions. [#982]
|
- Drop support for signing Zcash v3 transactions. [#982]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- CRW addresses are properly generated. [#1139]
|
- CRW addresses are properly generated. [#1139]
|
||||||
- Fix boot loop after uploading invalid homescreen. [#1118]
|
- Fix boot loop after uploading invalid homescreen. [#1118]
|
||||||
- Allow 49/x not 49/x' for Casa. [#1190]
|
- Allow 49/x not 49/x' for Casa. [#1190]
|
||||||
- Make sure Homescreen is properly initialized. [#1095]
|
- Make sure Homescreen is properly initialized. [#1095]
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
- Show non-empty passphrase on device when it was entered on host.
|
- Show non-empty passphrase on device when it was entered on host.
|
||||||
@ -89,7 +89,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- `Features.pin_cached` renamed to `unlocked`.
|
- `Features.pin_cached` renamed to `unlocked`.
|
||||||
- Forbid all settings if the device is not yet initialized. [#1056]
|
- Forbid all settings if the device is not yet initialized. [#1056]
|
||||||
- Rewrite USB codec and Protobuf decoder to be more memory-efficient. [#1089]
|
- Rewrite USB codec and Protobuf decoder to be more memory-efficient. [#1089]
|
||||||
- Allow compatibility namespaces for Casa and Green Address.
|
- Allow compatibility namespaces for Casa and Green Address.
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
- Deprecate `overwintered` field in `SignTx` and `TxAck`.
|
- Deprecate `overwintered` field in `SignTx` and `TxAck`.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Trezor Core
|
# Trezor Core
|
||||||
|
|
||||||
Firmware currently running on Model T.
|
Firmware currently running on Model T.
|
||||||
|
|
||||||
See `docs/core` for more info.
|
See `docs/core` for more info.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
reset_handler:
|
reset_handler:
|
||||||
|
|
||||||
// The following loading of VTOR address only works if T1 bootloader was built with MEMORY_PROTECT=0
|
// The following loading of VTOR address only works if T1 bootloader was built with MEMORY_PROTECT=0
|
||||||
// or the firmware was properly signed. All other variants end up in hard fault due to MPU
|
// or the firmware was properly signed. All other variants end up in hard fault due to MPU
|
||||||
// (cf mpu_config_firmware in legacy bootloader)
|
// (cf mpu_config_firmware in legacy bootloader)
|
||||||
|
|
||||||
#if TREZOR_MODEL == 1
|
#if TREZOR_MODEL == 1
|
||||||
|
@ -132,7 +132,7 @@ def cli(
|
|||||||
|
|
||||||
If -c is specified, extra arguments are treated as a command that is executed with
|
If -c is specified, extra arguments are treated as a command that is executed with
|
||||||
the running emulator. This command can access the following environment variables:
|
the running emulator. This command can access the following environment variables:
|
||||||
|
|
||||||
\b
|
\b
|
||||||
TREZOR_PROFILE_DIR - path to storage directory
|
TREZOR_PROFILE_DIR - path to storage directory
|
||||||
TREZOR_PATH - trezorlib connection string
|
TREZOR_PATH - trezorlib connection string
|
||||||
|
@ -22,4 +22,4 @@ Transfer
|
|||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Mnemonic for recovering wallet used in binance sdk tests:
|
Mnemonic for recovering wallet used in binance sdk tests:
|
||||||
offer caution gift cross surge pretty orange during eye soldier popular holiday mention east eight office fashion ill parrot vault rent devote earth cousin
|
offer caution gift cross surge pretty orange during eye soldier popular holiday mention east eight office fashion ill parrot vault rent devote earth cousin
|
||||||
|
@ -12,11 +12,11 @@ REVIEWER = Jan Matejek <jan.matejek@satoshilabs.com>, Tomas Susanka <tomas.susan
|
|||||||
|
|
||||||
## Useful links
|
## Useful links
|
||||||
|
|
||||||
[Cardano documentation](https://docs.cardano.org/en/latest/) - official documentation.
|
[Cardano documentation](https://docs.cardano.org/en/latest/) - official documentation.
|
||||||
[Delegation Design Spec](https://hydra.iohk.io/build/2006688/download/1/delegation_design_spec.pdf) - contains information about delegation (addresses, certificates, withdrawals, ...).
|
[Delegation Design Spec](https://hydra.iohk.io/build/2006688/download/1/delegation_design_spec.pdf) - contains information about delegation (addresses, certificates, withdrawals, ...).
|
||||||
[Shelley CDDL spec](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl).
|
[Shelley CDDL spec](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl).
|
||||||
[Byron address format](https://github.com/input-output-hk/cardano-wallet/wiki/About-Address-Format---Byron).
|
[Byron address format](https://github.com/input-output-hk/cardano-wallet/wiki/About-Address-Format---Byron).
|
||||||
[The Shelley 1852' purpose and staking path](https://github.com/input-output-hk/implementation-decisions/blob/e2d1bed5e617f0907bc5e12cf1c3f3302a4a7c42/text/1852-hd-chimeric.md).
|
[The Shelley 1852' purpose and staking path](https://github.com/input-output-hk/implementation-decisions/blob/e2d1bed5e617f0907bc5e12cf1c3f3302a4a7c42/text/1852-hd-chimeric.md).
|
||||||
[cbor.me](http://cbor.me/) - very useful tool for CBOR inspection.
|
[cbor.me](http://cbor.me/) - very useful tool for CBOR inspection.
|
||||||
|
|
||||||
## Important notes
|
## Important notes
|
||||||
@ -29,8 +29,8 @@ Cardano uses extended public keys. This also means that the transaction signatur
|
|||||||
|
|
||||||
## Protocol magic vs. Network id
|
## Protocol magic vs. Network id
|
||||||
|
|
||||||
Protocol magic is used to identify the network on the protocol level. Each network (mainnet, testnet, testnet 2, ...) has its own protocol magic. It's a 4 byte number. Network Id is a more compact version of the protocol magic - it's only 4 bits. It is used in addresses to determine, whether they belong to a testnet or any of the (possibly in the future existing) mainnets. Network Id 0 is reserved for all the testnets that might ever exist and the remaining 15 values are used for mainnets.
|
Protocol magic is used to identify the network on the protocol level. Each network (mainnet, testnet, testnet 2, ...) has its own protocol magic. It's a 4 byte number. Network Id is a more compact version of the protocol magic - it's only 4 bits. It is used in addresses to determine, whether they belong to a testnet or any of the (possibly in the future existing) mainnets. Network Id 0 is reserved for all the testnets that might ever exist and the remaining 15 values are used for mainnets.
|
||||||
_Current mainnet protocol magic:_ 764824073
|
_Current mainnet protocol magic:_ 764824073
|
||||||
_Current mainnet network id:_ 1
|
_Current mainnet network id:_ 1
|
||||||
|
|
||||||
## Key types
|
## Key types
|
||||||
@ -47,45 +47,45 @@ In Shelley, address encoding has been switched from Base58 to Bech32. However, B
|
|||||||
|
|
||||||
#### Byron address
|
#### Byron address
|
||||||
|
|
||||||
Legacy address used mainly during the Byron era, but still supported in Shelley. Has no staking rights. More about address format can be found [here](https://github.com/input-output-hk/cardano-wallet/wiki/About-Address-Format---Byron).
|
Legacy address used mainly during the Byron era, but still supported in Shelley. Has no staking rights. More about address format can be found [here](https://github.com/input-output-hk/cardano-wallet/wiki/About-Address-Format---Byron).
|
||||||
**Example:**
|
**Example:**
|
||||||
Mainnet: `Ae2tdPwUPEZCanmBz5g2GEwFqKTKpNJcGYPKfDxoNeKZ8bRHr8366kseiK2`
|
Mainnet: `Ae2tdPwUPEZCanmBz5g2GEwFqKTKpNJcGYPKfDxoNeKZ8bRHr8366kseiK2`
|
||||||
Testnet: `2657WMsDfac7BteXkJq5Jzdog4h47fPbkwUM49isuWbYAr2cFRHa3rURP236h9PBe`
|
Testnet: `2657WMsDfac7BteXkJq5Jzdog4h47fPbkwUM49isuWbYAr2cFRHa3rURP236h9PBe`
|
||||||
|
|
||||||
#### Base address
|
#### Base address
|
||||||
|
|
||||||
Introduced in Shelley:
|
Introduced in Shelley:
|
||||||
`[header] + [payment_key_hash] + [staking_key_hash]`
|
`[header] + [payment_key_hash] + [staking_key_hash]`
|
||||||
Base address can have staking rights (as it contains a staking key hash), but the staking key has to be registered on the blockchain first. Funds can be received even without the staking key being registered though. It is also possible to own the funds (payment key) but to use a different staking key to build the address. This would transfer the staking rights to the owner of the staking key. This can be useful for staking your funds for a charity.
|
Base address can have staking rights (as it contains a staking key hash), but the staking key has to be registered on the blockchain first. Funds can be received even without the staking key being registered though. It is also possible to own the funds (payment key) but to use a different staking key to build the address. This would transfer the staking rights to the owner of the staking key. This can be useful for staking your funds for a charity.
|
||||||
**Example:**
|
**Example:**
|
||||||
Mainnet: `addr1q8v42wjda8r6mpfj40d36znlgfdcqp7jtj03ah8skh6u8wnrqua2vw243tmjfjt0h5wsru6appuz8c0pfd75ur7myyeqsx9990`
|
Mainnet: `addr1q8v42wjda8r6mpfj40d36znlgfdcqp7jtj03ah8skh6u8wnrqua2vw243tmjfjt0h5wsru6appuz8c0pfd75ur7myyeqsx9990`
|
||||||
Testnet: `addr_test1qrv42wjda8r6mpfj40d36znlgfdcqp7jtj03ah8skh6u8wnrqua2vw243tmjfjt0h5wsru6appuz8c0pfd75ur7myyeqnsc9fs`
|
Testnet: `addr_test1qrv42wjda8r6mpfj40d36znlgfdcqp7jtj03ah8skh6u8wnrqua2vw243tmjfjt0h5wsru6appuz8c0pfd75ur7myyeqnsc9fs`
|
||||||
|
|
||||||
#### Pointer address
|
#### Pointer address
|
||||||
|
|
||||||
Introduced in Shelley:
|
Introduced in Shelley:
|
||||||
`[header] + [payment_key_hash] + [certificate_pointer]`
|
`[header] + [payment_key_hash] + [certificate_pointer]`
|
||||||
Certificate pointer is a pointer `(block, transaction, certificate)` to the staking key registration certificate on the blockchain. It replaces `staking_key_hash` from base address, but serves the same purpose. Thus pointer address is pretty much the same as base address in function, but is much shorter (~35B vs 57B) thanks to the certificate pointer.
|
Certificate pointer is a pointer `(block, transaction, certificate)` to the staking key registration certificate on the blockchain. It replaces `staking_key_hash` from base address, but serves the same purpose. Thus pointer address is pretty much the same as base address in function, but is much shorter (~35B vs 57B) thanks to the certificate pointer.
|
||||||
**Example:**
|
**Example:**
|
||||||
Mainnet: `addr1gxq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92spqgpsl97q83`
|
Mainnet: `addr1gxq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92spqgpsl97q83`
|
||||||
Testnet: `addr_test1gzq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z925ph3wczvf2ag2x9t`
|
Testnet: `addr_test1gzq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z925ph3wczvf2ag2x9t`
|
||||||
|
|
||||||
#### Enterprise address
|
#### Enterprise address
|
||||||
|
|
||||||
Introduced in Shelley:
|
Introduced in Shelley:
|
||||||
`[header] + [payment_key_hash]`
|
`[header] + [payment_key_hash]`
|
||||||
Entreprise address has no staking rights. This is useful for example for exchanges which contain a lot of funds and thus would control too much stake.
|
Entreprise address has no staking rights. This is useful for example for exchanges which contain a lot of funds and thus would control too much stake.
|
||||||
**Example:**
|
**Example:**
|
||||||
Mainnet: `addr1vxq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92su77c6m`
|
Mainnet: `addr1vxq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92su77c6m`
|
||||||
Testnet: `addr_test1vzq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92s8k2y47`
|
Testnet: `addr_test1vzq0nckg3ekgzuqg7w5p9mvgnd9ym28qh5grlph8xd2z92s8k2y47`
|
||||||
|
|
||||||
#### Reward address
|
#### Reward address
|
||||||
|
|
||||||
Introduced in Shelley:
|
Introduced in Shelley:
|
||||||
`[header] + [staking_key_hash]`
|
`[header] + [staking_key_hash]`
|
||||||
Staking rewards are gathered on this address after stake registration and delegation. They can then be withdrawn by a transaction with `withdrawals` filled in. All of the rewards have to be taken out at once.
|
Staking rewards are gathered on this address after stake registration and delegation. They can then be withdrawn by a transaction with `withdrawals` filled in. All of the rewards have to be taken out at once.
|
||||||
**Example:**
|
**Example:**
|
||||||
Mainnet: `stake1uyfz49rtntfa9h0s98f6s28sg69weemgjhc4e8hm66d5yacalmqha`
|
Mainnet: `stake1uyfz49rtntfa9h0s98f6s28sg69weemgjhc4e8hm66d5yacalmqha`
|
||||||
Testnet: `stake_test1uqfz49rtntfa9h0s98f6s28sg69weemgjhc4e8hm66d5yac643znq`
|
Testnet: `stake_test1uqfz49rtntfa9h0s98f6s28sg69weemgjhc4e8hm66d5yac643znq`
|
||||||
|
|
||||||
|
|
||||||
@ -99,11 +99,11 @@ _Unfortunately we are aware of the fact that currently at most ~14 inputs are su
|
|||||||
|
|
||||||
Transactions need a witness (signature) for each input, withdrawal and some certificates. A witness for each key is included only once in a transaction. The signature is built using the `ed25519.sign_ext` function. There are significant differences between Byron and Shelley witnesses - although we need to support both, because a transaction may have Byron inputs.
|
Transactions need a witness (signature) for each input, withdrawal and some certificates. A witness for each key is included only once in a transaction. The signature is built using the `ed25519.sign_ext` function. There are significant differences between Byron and Shelley witnesses - although we need to support both, because a transaction may have Byron inputs.
|
||||||
|
|
||||||
_Shelley witnesses_:
|
_Shelley witnesses_:
|
||||||
They only need to contain the public key (not the extended public key) and the signature. Nothing else is needed to verify the signature, although the signing happens with an extended private key.
|
They only need to contain the public key (not the extended public key) and the signature. Nothing else is needed to verify the signature, although the signing happens with an extended private key.
|
||||||
|
|
||||||
_Byron witnesses_:
|
_Byron witnesses_:
|
||||||
In order to be able to properly verify them, Byron witnesses need to contain the public key, signature, chain code and address attributes (which are empty on mainnet or contain the protocol magic on testnet).
|
In order to be able to properly verify them, Byron witnesses need to contain the public key, signature, chain code and address attributes (which are empty on mainnet or contain the protocol magic on testnet).
|
||||||
|
|
||||||
More on witness structure can be found [here](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl#L213).
|
More on witness structure can be found [here](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl#L213).
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ And these three which are not supported by Trezor at the moment:
|
|||||||
|
|
||||||
Stake key de-registration and delegation certificates both need to be witnessed by the corresponding staking key.
|
Stake key de-registration and delegation certificates both need to be witnessed by the corresponding staking key.
|
||||||
|
|
||||||
You can read more on certificates in the [delegation design spec](https://hydra.iohk.io/build/2006688/download/1/delegation_design_spec.pdf#subsection.3.4).
|
You can read more on certificates in the [delegation design spec](https://hydra.iohk.io/build/2006688/download/1/delegation_design_spec.pdf#subsection.3.4).
|
||||||
Info about their structure can be found [here](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl#L102).
|
Info about their structure can be found [here](https://github.com/input-output-hk/cardano-ledger-specs/blob/460ee17d22cacb3ac4d90536ebe90500a356a1c9/shelley/chain-and-ledger/shelley-spec-ledger-test/cddl-files/shelley.cddl#L102).
|
||||||
|
|
||||||
#### Withdrawals
|
#### Withdrawals
|
||||||
@ -157,49 +157,49 @@ Cardano uses [CBOR](https://www.rfc-editor.org/info/rfc7049) as a serialization
|
|||||||
```
|
```
|
||||||
# transaction
|
# transaction
|
||||||
# array(3)
|
# array(3)
|
||||||
[
|
[
|
||||||
# transaction body
|
# transaction body
|
||||||
# map(6)
|
# map(6)
|
||||||
{
|
{
|
||||||
# inputs [id, index]
|
# inputs [id, index]
|
||||||
# uint(0), array(1), array(2), bytes(32), uint(0)
|
# uint(0), array(1), array(2), bytes(32), uint(0)
|
||||||
0: [[h'0D4...', 0]],
|
0: [[h'0D4...', 0]],
|
||||||
|
|
||||||
# outputs [address, amount]
|
# outputs [address, amount]
|
||||||
# uint(1), array(1), array(2), bytes(57), uint(107285535181)
|
# uint(1), array(1), array(2), bytes(57), uint(107285535181)
|
||||||
1: [[h'006...', 107285535181]],
|
1: [[h'006...', 107285535181]],
|
||||||
|
|
||||||
# fee
|
# fee
|
||||||
# uint(2), uint(200000)
|
# uint(2), uint(200000)
|
||||||
2: 200000,
|
2: 200000,
|
||||||
|
|
||||||
# ttl
|
# ttl
|
||||||
# uint(3), uint(500000)
|
# uint(3), uint(500000)
|
||||||
3: 500000,
|
3: 500000,
|
||||||
|
|
||||||
# certificates [[type, [keyhash/scripthash, keyhash]]]
|
# certificates [[type, [keyhash/scripthash, keyhash]]]
|
||||||
# uint(4), array(1), array(2), uint(1), array(2), uint(0), bytes(28)
|
# uint(4), array(1), array(2), uint(1), array(2), uint(0), bytes(28)
|
||||||
4: [[1,[0, h'F22...']]],
|
4: [[1,[0, h'F22...']]],
|
||||||
|
|
||||||
# withdrawal [reward_address: amount]
|
# withdrawal [reward_address: amount]
|
||||||
# uint(5), map(1), bytes(29), uint(7204944340)
|
# uint(5), map(1), bytes(29), uint(7204944340)
|
||||||
5: {h'E06...': 7204944340}
|
5: {h'E06...': 7204944340}
|
||||||
},
|
},
|
||||||
# witnesses
|
# witnesses
|
||||||
# map(1)
|
# map(1)
|
||||||
{
|
{
|
||||||
# verifying key witnesses [[vkey -> signature]]
|
# verifying key witnesses [[vkey -> signature]]
|
||||||
# uint(0), array(2)
|
# uint(0), array(2)
|
||||||
0: [
|
0: [
|
||||||
# array(2), bytes(32), bytes(64)
|
# array(2), bytes(32), bytes(64)
|
||||||
[h'D19...', h'F62...'],
|
[h'D19...', h'F62...'],
|
||||||
# array(2), bytes(32), bytes(64)
|
# array(2), bytes(32), bytes(64)
|
||||||
[h'F1C...', h'7AC...']
|
[h'F1C...', h'7AC...']
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
# metadata
|
# metadata
|
||||||
# primitive(22)
|
# primitive(22)
|
||||||
null
|
null
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
@ -197,7 +197,7 @@ Trezor computes spending keys, `TxinToKey`, `pseudo_out`, HMACs for offloaded da
|
|||||||
UTXOs have to be sorted by the key image in the valid blockchain transaction.
|
UTXOs have to be sorted by the key image in the valid blockchain transaction.
|
||||||
This message caries permutation on the key images so they are sorted in the desired way.
|
This message caries permutation on the key images so they are sorted in the desired way.
|
||||||
|
|
||||||
In Client version 3+ sending the permutation is deprecated. Original sort index is sent from the host
|
In Client version 3+ sending the permutation is deprecated. Original sort index is sent from the host
|
||||||
when needed (to verify HMACs built on the original ordering). Moreover, permutation correctness is checked by
|
when needed (to verify HMACs built on the original ordering). Moreover, permutation correctness is checked by
|
||||||
the set size, HMAC validity and strict ordering on the key images.
|
the set size, HMAC validity and strict ordering on the key images.
|
||||||
|
|
||||||
|
@ -15,4 +15,4 @@ class TestSomething(unittest.TestCase):
|
|||||||
self.assertTrue(True)
|
self.assertTrue(True)
|
||||||
```
|
```
|
||||||
|
|
||||||
Usage of `assert` is discouraged because it is not evaluated in production code (when `PYOPT=1`). Use `self.assertXY` instead, see `unittest.py`.
|
Usage of `assert` is discouraged because it is not evaluated in production code (when `PYOPT=1`). Use `self.assertXY` instead, see `unittest.py`.
|
||||||
|
@ -48,7 +48,7 @@ class TestBinanceSign(unittest.TestCase):
|
|||||||
self.assertEqual(signature, unhexlify(expected_signature))
|
self.assertEqual(signature, unhexlify(expected_signature))
|
||||||
|
|
||||||
def test_cancel_signature(self):
|
def test_cancel_signature(self):
|
||||||
# source of testing data
|
# source of testing data
|
||||||
# https://github.com/binance-chain/javascript-sdk/blob/master/__tests__/fixtures/cancelOrder.json
|
# https://github.com/binance-chain/javascript-sdk/blob/master/__tests__/fixtures/cancelOrder.json
|
||||||
json_msg = '{"account_number":"34","chain_id":"Binance-Chain-Nile","data":null,"memo":"","msgs":[{"refid":"BA36F0FAD74D8F41045463E4774F328F4AF779E5-29","sender":"tbnb1hgm0p7khfk85zpz5v0j8wnej3a90w709zzlffd","symbol":"BCHSV.B-10F_BNB"}],"sequence":"33","source":"1"}'
|
json_msg = '{"account_number":"34","chain_id":"Binance-Chain-Nile","data":null,"memo":"","msgs":[{"refid":"BA36F0FAD74D8F41045463E4774F328F4AF779E5-29","sender":"tbnb1hgm0p7khfk85zpz5v0j8wnej3a90w709zzlffd","symbol":"BCHSV.B-10F_BNB"}],"sequence":"33","source":"1"}'
|
||||||
expected_signature = "d93fb0402b2b30e7ea08e123bb139ad68bf0a1577f38592eb22d11e127f09bbd3380f29b4bf15bdfa973454c5c8ed444f2e256e956fe98cfd21e886a946e21e5"
|
expected_signature = "d93fb0402b2b30e7ea08e123bb139ad68bf0a1577f38592eb22d11e127f09bbd3380f29b4bf15bdfa973454c5c8ed444f2e256e956fe98cfd21e886a946e21e5"
|
||||||
@ -74,8 +74,8 @@ class TestBinanceSign(unittest.TestCase):
|
|||||||
self.assertEqual(signature, unhexlify(expected_signature))
|
self.assertEqual(signature, unhexlify(expected_signature))
|
||||||
|
|
||||||
def test_transfer_signature(self):
|
def test_transfer_signature(self):
|
||||||
# source of testing data
|
# source of testing data
|
||||||
# https://github.com/binance-chain/javascript-sdk/blob/master/__tests__/fixtures/transfer.json
|
# https://github.com/binance-chain/javascript-sdk/blob/master/__tests__/fixtures/transfer.json
|
||||||
json_msg = '{"account_number":"34","chain_id":"Binance-Chain-Nile","data":null,"memo":"test","msgs":[{"inputs":[{"address":"tbnb1hgm0p7khfk85zpz5v0j8wnej3a90w709zzlffd","coins":[{"amount":1000000000,"denom":"BNB"}]}],"outputs":[{"address":"tbnb1ss57e8sa7xnwq030k2ctr775uac9gjzglqhvpy","coins":[{"amount":1000000000,"denom":"BNB"}]}]}],"sequence":"31","source":"1"}'
|
json_msg = '{"account_number":"34","chain_id":"Binance-Chain-Nile","data":null,"memo":"test","msgs":[{"inputs":[{"address":"tbnb1hgm0p7khfk85zpz5v0j8wnej3a90w709zzlffd","coins":[{"amount":1000000000,"denom":"BNB"}]}],"outputs":[{"address":"tbnb1ss57e8sa7xnwq030k2ctr775uac9gjzglqhvpy","coins":[{"amount":1000000000,"denom":"BNB"}]}]}],"sequence":"31","source":"1"}'
|
||||||
expected_signature = "faf5b908d6c4ec0c7e2e7d8f7e1b9ca56ac8b1a22b01655813c62ce89bf84a4c7b14f58ce51e85d64c13f47e67d6a9187b8f79f09e0a9b82019f47ae190a4db3"
|
expected_signature = "faf5b908d6c4ec0c7e2e7d8f7e1b9ca56ac8b1a22b01655813c62ce89bf84a4c7b14f58ce51e85d64c13f47e67d6a9187b8f79f09e0a9b82019f47ae190a4db3"
|
||||||
public_key = "029729a52e4e3c2b4a4e52aa74033eedaf8ba1df5ab6d1f518fd69e67bbd309b0e"
|
public_key = "029729a52e4e3c2b4a4e52aa74033eedaf8ba1df5ab6d1f518fd69e67bbd309b0e"
|
||||||
|
@ -8,9 +8,9 @@ if not utils.BITCOIN_ONLY:
|
|||||||
class TestCardanoUtils(unittest.TestCase):
|
class TestCardanoUtils(unittest.TestCase):
|
||||||
def test_variable_length_encode(self):
|
def test_variable_length_encode(self):
|
||||||
test_vectors = [
|
test_vectors = [
|
||||||
(0, bytes([0x00])),
|
(0, bytes([0x00])),
|
||||||
(42, bytes([0x2A])),
|
(42, bytes([0x2A])),
|
||||||
(127, bytes([0x7F])),
|
(127, bytes([0x7F])),
|
||||||
(128, bytes([0x81, 0x00])),
|
(128, bytes([0x81, 0x00])),
|
||||||
(129, bytes([0x81, 0x01])),
|
(129, bytes([0x81, 0x01])),
|
||||||
(255, bytes([0x81, 0x7F])),
|
(255, bytes([0x81, 0x7F])),
|
||||||
|
@ -44,7 +44,7 @@ class TestNemAddress(unittest.TestCase):
|
|||||||
self.assertTrue(check_path([44 | HARDENED, 1 | HARDENED, 0 | HARDENED, 0 | HARDENED, 0 | HARDENED], NEM_NETWORK_TESTNET))
|
self.assertTrue(check_path([44 | HARDENED, 1 | HARDENED, 0 | HARDENED, 0 | HARDENED, 0 | HARDENED], NEM_NETWORK_TESTNET))
|
||||||
# short path (check_path does not validate pattern match):
|
# short path (check_path does not validate pattern match):
|
||||||
self.assertTrue(check_path([44 | HARDENED, 43 | HARDENED], NEM_NETWORK_MAINNET))
|
self.assertTrue(check_path([44 | HARDENED, 43 | HARDENED], NEM_NETWORK_MAINNET))
|
||||||
|
|
||||||
# testnet path on mainnet:
|
# testnet path on mainnet:
|
||||||
self.assertFalse(check_path([44 | HARDENED, 1 | HARDENED, 0 | HARDENED, 0 | HARDENED, 0 | HARDENED], NEM_NETWORK_MAINNET))
|
self.assertFalse(check_path([44 | HARDENED, 1 | HARDENED, 0 | HARDENED, 0 | HARDENED, 0 | HARDENED], NEM_NETWORK_MAINNET))
|
||||||
# mainnet path on testnet:
|
# mainnet path on testnet:
|
||||||
|
@ -1,121 +1,121 @@
|
|||||||
Creative Commons Legal Code
|
Creative Commons Legal Code
|
||||||
|
|
||||||
CC0 1.0 Universal
|
CC0 1.0 Universal
|
||||||
|
|
||||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
HEREUNDER.
|
HEREUNDER.
|
||||||
|
|
||||||
Statement of Purpose
|
Statement of Purpose
|
||||||
|
|
||||||
The laws of most jurisdictions throughout the world automatically confer
|
The laws of most jurisdictions throughout the world automatically confer
|
||||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||||
authorship and/or a database (each, a "Work").
|
authorship and/or a database (each, a "Work").
|
||||||
|
|
||||||
Certain owners wish to permanently relinquish those rights to a Work for
|
Certain owners wish to permanently relinquish those rights to a Work for
|
||||||
the purpose of contributing to a commons of creative, cultural and
|
the purpose of contributing to a commons of creative, cultural and
|
||||||
scientific works ("Commons") that the public can reliably and without fear
|
scientific works ("Commons") that the public can reliably and without fear
|
||||||
of later claims of infringement build upon, modify, incorporate in other
|
of later claims of infringement build upon, modify, incorporate in other
|
||||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||||
and for any purposes, including without limitation commercial purposes.
|
and for any purposes, including without limitation commercial purposes.
|
||||||
These owners may contribute to the Commons to promote the ideal of a free
|
These owners may contribute to the Commons to promote the ideal of a free
|
||||||
culture and the further production of creative, cultural and scientific
|
culture and the further production of creative, cultural and scientific
|
||||||
works, or to gain reputation or greater distribution for their Work in
|
works, or to gain reputation or greater distribution for their Work in
|
||||||
part through the use and efforts of others.
|
part through the use and efforts of others.
|
||||||
|
|
||||||
For these and/or other purposes and motivations, and without any
|
For these and/or other purposes and motivations, and without any
|
||||||
expectation of additional consideration or compensation, the person
|
expectation of additional consideration or compensation, the person
|
||||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||||
|
|
||||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||||
protected by copyright and related or neighboring rights ("Copyright and
|
protected by copyright and related or neighboring rights ("Copyright and
|
||||||
Related Rights"). Copyright and Related Rights include, but are not
|
Related Rights"). Copyright and Related Rights include, but are not
|
||||||
limited to, the following:
|
limited to, the following:
|
||||||
|
|
||||||
i. the right to reproduce, adapt, distribute, perform, display,
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
communicate, and translate a Work;
|
communicate, and translate a Work;
|
||||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
iii. publicity and privacy rights pertaining to a person's image or
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
likeness depicted in a Work;
|
likeness depicted in a Work;
|
||||||
iv. rights protecting against unfair competition in regards to a Work,
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
subject to the limitations in paragraph 4(a), below;
|
subject to the limitations in paragraph 4(a), below;
|
||||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
in a Work;
|
in a Work;
|
||||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
European Parliament and of the Council of 11 March 1996 on the legal
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
protection of databases, and under any national implementation
|
protection of databases, and under any national implementation
|
||||||
thereof, including any amended or successor version of such
|
thereof, including any amended or successor version of such
|
||||||
directive); and
|
directive); and
|
||||||
vii. other similar, equivalent or corresponding rights throughout the
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
world based on applicable law or treaty, and any national
|
world based on applicable law or treaty, and any national
|
||||||
implementations thereof.
|
implementations thereof.
|
||||||
|
|
||||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||||
of action, whether now known or unknown (including existing as well as
|
of action, whether now known or unknown (including existing as well as
|
||||||
future claims and causes of action), in the Work (i) in all territories
|
future claims and causes of action), in the Work (i) in all territories
|
||||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||||
treaty (including future time extensions), (iii) in any current or future
|
treaty (including future time extensions), (iii) in any current or future
|
||||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||||
including without limitation commercial, advertising or promotional
|
including without limitation commercial, advertising or promotional
|
||||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||||
member of the public at large and to the detriment of Affirmer's heirs and
|
member of the public at large and to the detriment of Affirmer's heirs and
|
||||||
successors, fully intending that such Waiver shall not be subject to
|
successors, fully intending that such Waiver shall not be subject to
|
||||||
revocation, rescission, cancellation, termination, or any other legal or
|
revocation, rescission, cancellation, termination, or any other legal or
|
||||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||||
as contemplated by Affirmer's express Statement of Purpose.
|
as contemplated by Affirmer's express Statement of Purpose.
|
||||||
|
|
||||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||||
be judged legally invalid or ineffective under applicable law, then the
|
be judged legally invalid or ineffective under applicable law, then the
|
||||||
Waiver shall be preserved to the maximum extent permitted taking into
|
Waiver shall be preserved to the maximum extent permitted taking into
|
||||||
account Affirmer's express Statement of Purpose. In addition, to the
|
account Affirmer's express Statement of Purpose. In addition, to the
|
||||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||||
maximum duration provided by applicable law or treaty (including future
|
maximum duration provided by applicable law or treaty (including future
|
||||||
time extensions), (iii) in any current or future medium and for any number
|
time extensions), (iii) in any current or future medium and for any number
|
||||||
of copies, and (iv) for any purpose whatsoever, including without
|
of copies, and (iv) for any purpose whatsoever, including without
|
||||||
limitation commercial, advertising or promotional purposes (the
|
limitation commercial, advertising or promotional purposes (the
|
||||||
"License"). The License shall be deemed effective as of the date CC0 was
|
"License"). The License shall be deemed effective as of the date CC0 was
|
||||||
applied by Affirmer to the Work. Should any part of the License for any
|
applied by Affirmer to the Work. Should any part of the License for any
|
||||||
reason be judged legally invalid or ineffective under applicable law, such
|
reason be judged legally invalid or ineffective under applicable law, such
|
||||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||||
of the License, and in such case Affirmer hereby affirms that he or she
|
of the License, and in such case Affirmer hereby affirms that he or she
|
||||||
will not (i) exercise any of his or her remaining Copyright and Related
|
will not (i) exercise any of his or her remaining Copyright and Related
|
||||||
Rights in the Work or (ii) assert any associated claims and causes of
|
Rights in the Work or (ii) assert any associated claims and causes of
|
||||||
action with respect to the Work, in either case contrary to Affirmer's
|
action with respect to the Work, in either case contrary to Affirmer's
|
||||||
express Statement of Purpose.
|
express Statement of Purpose.
|
||||||
|
|
||||||
4. Limitations and Disclaimers.
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
surrendered, licensed or otherwise affected by this document.
|
surrendered, licensed or otherwise affected by this document.
|
||||||
b. Affirmer offers the Work as-is and makes no representations or
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
warranties of any kind concerning the Work, express, implied,
|
warranties of any kind concerning the Work, express, implied,
|
||||||
statutory or otherwise, including without limitation warranties of
|
statutory or otherwise, including without limitation warranties of
|
||||||
title, merchantability, fitness for a particular purpose, non
|
title, merchantability, fitness for a particular purpose, non
|
||||||
infringement, or the absence of latent or other defects, accuracy, or
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
the present or absence of errors, whether or not discoverable, all to
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
the greatest extent permissible under applicable law.
|
the greatest extent permissible under applicable law.
|
||||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
that may apply to the Work or any use thereof, including without
|
that may apply to the Work or any use thereof, including without
|
||||||
limitation any person's Copyright and Related Rights in the Work.
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
consents, permissions or other rights required for any use of the
|
consents, permissions or other rights required for any use of the
|
||||||
Work.
|
Work.
|
||||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
party to this document and has no duty or obligation with respect to
|
party to this document and has no duty or obligation with respect to
|
||||||
this CC0 or use of the Work.
|
this CC0 or use of the Work.
|
||||||
|
@ -1,121 +1,121 @@
|
|||||||
Creative Commons Legal Code
|
Creative Commons Legal Code
|
||||||
|
|
||||||
CC0 1.0 Universal
|
CC0 1.0 Universal
|
||||||
|
|
||||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
HEREUNDER.
|
HEREUNDER.
|
||||||
|
|
||||||
Statement of Purpose
|
Statement of Purpose
|
||||||
|
|
||||||
The laws of most jurisdictions throughout the world automatically confer
|
The laws of most jurisdictions throughout the world automatically confer
|
||||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||||
authorship and/or a database (each, a "Work").
|
authorship and/or a database (each, a "Work").
|
||||||
|
|
||||||
Certain owners wish to permanently relinquish those rights to a Work for
|
Certain owners wish to permanently relinquish those rights to a Work for
|
||||||
the purpose of contributing to a commons of creative, cultural and
|
the purpose of contributing to a commons of creative, cultural and
|
||||||
scientific works ("Commons") that the public can reliably and without fear
|
scientific works ("Commons") that the public can reliably and without fear
|
||||||
of later claims of infringement build upon, modify, incorporate in other
|
of later claims of infringement build upon, modify, incorporate in other
|
||||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||||
and for any purposes, including without limitation commercial purposes.
|
and for any purposes, including without limitation commercial purposes.
|
||||||
These owners may contribute to the Commons to promote the ideal of a free
|
These owners may contribute to the Commons to promote the ideal of a free
|
||||||
culture and the further production of creative, cultural and scientific
|
culture and the further production of creative, cultural and scientific
|
||||||
works, or to gain reputation or greater distribution for their Work in
|
works, or to gain reputation or greater distribution for their Work in
|
||||||
part through the use and efforts of others.
|
part through the use and efforts of others.
|
||||||
|
|
||||||
For these and/or other purposes and motivations, and without any
|
For these and/or other purposes and motivations, and without any
|
||||||
expectation of additional consideration or compensation, the person
|
expectation of additional consideration or compensation, the person
|
||||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||||
|
|
||||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||||
protected by copyright and related or neighboring rights ("Copyright and
|
protected by copyright and related or neighboring rights ("Copyright and
|
||||||
Related Rights"). Copyright and Related Rights include, but are not
|
Related Rights"). Copyright and Related Rights include, but are not
|
||||||
limited to, the following:
|
limited to, the following:
|
||||||
|
|
||||||
i. the right to reproduce, adapt, distribute, perform, display,
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
communicate, and translate a Work;
|
communicate, and translate a Work;
|
||||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
iii. publicity and privacy rights pertaining to a person's image or
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
likeness depicted in a Work;
|
likeness depicted in a Work;
|
||||||
iv. rights protecting against unfair competition in regards to a Work,
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
subject to the limitations in paragraph 4(a), below;
|
subject to the limitations in paragraph 4(a), below;
|
||||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
in a Work;
|
in a Work;
|
||||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
European Parliament and of the Council of 11 March 1996 on the legal
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
protection of databases, and under any national implementation
|
protection of databases, and under any national implementation
|
||||||
thereof, including any amended or successor version of such
|
thereof, including any amended or successor version of such
|
||||||
directive); and
|
directive); and
|
||||||
vii. other similar, equivalent or corresponding rights throughout the
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
world based on applicable law or treaty, and any national
|
world based on applicable law or treaty, and any national
|
||||||
implementations thereof.
|
implementations thereof.
|
||||||
|
|
||||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||||
of action, whether now known or unknown (including existing as well as
|
of action, whether now known or unknown (including existing as well as
|
||||||
future claims and causes of action), in the Work (i) in all territories
|
future claims and causes of action), in the Work (i) in all territories
|
||||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||||
treaty (including future time extensions), (iii) in any current or future
|
treaty (including future time extensions), (iii) in any current or future
|
||||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||||
including without limitation commercial, advertising or promotional
|
including without limitation commercial, advertising or promotional
|
||||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||||
member of the public at large and to the detriment of Affirmer's heirs and
|
member of the public at large and to the detriment of Affirmer's heirs and
|
||||||
successors, fully intending that such Waiver shall not be subject to
|
successors, fully intending that such Waiver shall not be subject to
|
||||||
revocation, rescission, cancellation, termination, or any other legal or
|
revocation, rescission, cancellation, termination, or any other legal or
|
||||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||||
as contemplated by Affirmer's express Statement of Purpose.
|
as contemplated by Affirmer's express Statement of Purpose.
|
||||||
|
|
||||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||||
be judged legally invalid or ineffective under applicable law, then the
|
be judged legally invalid or ineffective under applicable law, then the
|
||||||
Waiver shall be preserved to the maximum extent permitted taking into
|
Waiver shall be preserved to the maximum extent permitted taking into
|
||||||
account Affirmer's express Statement of Purpose. In addition, to the
|
account Affirmer's express Statement of Purpose. In addition, to the
|
||||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||||
maximum duration provided by applicable law or treaty (including future
|
maximum duration provided by applicable law or treaty (including future
|
||||||
time extensions), (iii) in any current or future medium and for any number
|
time extensions), (iii) in any current or future medium and for any number
|
||||||
of copies, and (iv) for any purpose whatsoever, including without
|
of copies, and (iv) for any purpose whatsoever, including without
|
||||||
limitation commercial, advertising or promotional purposes (the
|
limitation commercial, advertising or promotional purposes (the
|
||||||
"License"). The License shall be deemed effective as of the date CC0 was
|
"License"). The License shall be deemed effective as of the date CC0 was
|
||||||
applied by Affirmer to the Work. Should any part of the License for any
|
applied by Affirmer to the Work. Should any part of the License for any
|
||||||
reason be judged legally invalid or ineffective under applicable law, such
|
reason be judged legally invalid or ineffective under applicable law, such
|
||||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||||
of the License, and in such case Affirmer hereby affirms that he or she
|
of the License, and in such case Affirmer hereby affirms that he or she
|
||||||
will not (i) exercise any of his or her remaining Copyright and Related
|
will not (i) exercise any of his or her remaining Copyright and Related
|
||||||
Rights in the Work or (ii) assert any associated claims and causes of
|
Rights in the Work or (ii) assert any associated claims and causes of
|
||||||
action with respect to the Work, in either case contrary to Affirmer's
|
action with respect to the Work, in either case contrary to Affirmer's
|
||||||
express Statement of Purpose.
|
express Statement of Purpose.
|
||||||
|
|
||||||
4. Limitations and Disclaimers.
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
surrendered, licensed or otherwise affected by this document.
|
surrendered, licensed or otherwise affected by this document.
|
||||||
b. Affirmer offers the Work as-is and makes no representations or
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
warranties of any kind concerning the Work, express, implied,
|
warranties of any kind concerning the Work, express, implied,
|
||||||
statutory or otherwise, including without limitation warranties of
|
statutory or otherwise, including without limitation warranties of
|
||||||
title, merchantability, fitness for a particular purpose, non
|
title, merchantability, fitness for a particular purpose, non
|
||||||
infringement, or the absence of latent or other defects, accuracy, or
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
the present or absence of errors, whether or not discoverable, all to
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
the greatest extent permissible under applicable law.
|
the greatest extent permissible under applicable law.
|
||||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
that may apply to the Work or any use thereof, including without
|
that may apply to the Work or any use thereof, including without
|
||||||
limitation any person's Copyright and Related Rights in the Work.
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
consents, permissions or other rights required for any use of the
|
consents, permissions or other rights required for any use of the
|
||||||
Work.
|
Work.
|
||||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
party to this document and has no duty or obligation with respect to
|
party to this document and has no duty or obligation with respect to
|
||||||
this CC0 or use of the Work.
|
this CC0 or use of the Work.
|
||||||
|
@ -1,202 +1,202 @@
|
|||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
1. Definitions.
|
1. Definitions.
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
the copyright owner that is granting the License.
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
other entities that control, are controlled by, or are under common
|
other entities that control, are controlled by, or are under common
|
||||||
control with that entity. For the purposes of this definition,
|
control with that entity. For the purposes of this definition,
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
direction or management of such entity, whether by contract or
|
direction or management of such entity, whether by contract or
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
exercising permissions granted by this License.
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
including but not limited to software source code, documentation
|
including but not limited to software source code, documentation
|
||||||
source, and configuration files.
|
source, and configuration files.
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
"Object" form shall mean any form resulting from mechanical
|
||||||
transformation or translation of a Source form, including but
|
transformation or translation of a Source form, including but
|
||||||
not limited to compiled object code, generated documentation,
|
not limited to compiled object code, generated documentation,
|
||||||
and conversions to other media types.
|
and conversions to other media types.
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
Object form, made available under the License, as indicated by a
|
Object form, made available under the License, as indicated by a
|
||||||
copyright notice that is included in or attached to the work
|
copyright notice that is included in or attached to the work
|
||||||
(an example is provided in the Appendix below).
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
form, that is based on (or derived from) the Work and for which the
|
form, that is based on (or derived from) the Work and for which the
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
of this License, Derivative Works shall not include works that remain
|
of this License, Derivative Works shall not include works that remain
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
the Work and Derivative Works thereof.
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
"Contribution" shall mean any work of authorship, including
|
||||||
the original version of the Work and any modifications or additions
|
the original version of the Work and any modifications or additions
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
means any form of electronic, verbal, or written communication sent
|
means any form of electronic, verbal, or written communication sent
|
||||||
to the Licensor or its representatives, including but not limited to
|
to the Licensor or its representatives, including but not limited to
|
||||||
communication on electronic mailing lists, source code control systems,
|
communication on electronic mailing lists, source code control systems,
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
excluding communication that is conspicuously marked or otherwise
|
excluding communication that is conspicuously marked or otherwise
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
subsequently incorporated within the Work.
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
Work and such Derivative Works in Source or Object form.
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
(except as stated in this section) patent license to make, have made,
|
(except as stated in this section) patent license to make, have made,
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
where such license applies only to those patent claims licensable
|
where such license applies only to those patent claims licensable
|
||||||
by such Contributor that are necessarily infringed by their
|
by such Contributor that are necessarily infringed by their
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
institute patent litigation against any entity (including a
|
institute patent litigation against any entity (including a
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
or contributory patent infringement, then any patent licenses
|
or contributory patent infringement, then any patent licenses
|
||||||
granted to You under this License for that Work shall terminate
|
granted to You under this License for that Work shall terminate
|
||||||
as of the date such litigation is filed.
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
modifications, and in Source or Object form, provided that You
|
modifications, and in Source or Object form, provided that You
|
||||||
meet the following conditions:
|
meet the following conditions:
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
(a) You must give any other recipients of the Work or
|
||||||
Derivative Works a copy of this License; and
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
(b) You must cause any modified files to carry prominent notices
|
||||||
stating that You changed the files; and
|
stating that You changed the files; and
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
that You distribute, all copyright, patent, trademark, and
|
that You distribute, all copyright, patent, trademark, and
|
||||||
attribution notices from the Source form of the Work,
|
attribution notices from the Source form of the Work,
|
||||||
excluding those notices that do not pertain to any part of
|
excluding those notices that do not pertain to any part of
|
||||||
the Derivative Works; and
|
the Derivative Works; and
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
distribution, then any Derivative Works that You distribute must
|
distribution, then any Derivative Works that You distribute must
|
||||||
include a readable copy of the attribution notices contained
|
include a readable copy of the attribution notices contained
|
||||||
within such NOTICE file, excluding those notices that do not
|
within such NOTICE file, excluding those notices that do not
|
||||||
pertain to any part of the Derivative Works, in at least one
|
pertain to any part of the Derivative Works, in at least one
|
||||||
of the following places: within a NOTICE text file distributed
|
of the following places: within a NOTICE text file distributed
|
||||||
as part of the Derivative Works; within the Source form or
|
as part of the Derivative Works; within the Source form or
|
||||||
documentation, if provided along with the Derivative Works; or,
|
documentation, if provided along with the Derivative Works; or,
|
||||||
within a display generated by the Derivative Works, if and
|
within a display generated by the Derivative Works, if and
|
||||||
wherever such third-party notices normally appear. The contents
|
wherever such third-party notices normally appear. The contents
|
||||||
of the NOTICE file are for informational purposes only and
|
of the NOTICE file are for informational purposes only and
|
||||||
do not modify the License. You may add Your own attribution
|
do not modify the License. You may add Your own attribution
|
||||||
notices within Derivative Works that You distribute, alongside
|
notices within Derivative Works that You distribute, alongside
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
that such additional attribution notices cannot be construed
|
that such additional attribution notices cannot be construed
|
||||||
as modifying the License.
|
as modifying the License.
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
You may add Your own copyright statement to Your modifications and
|
||||||
may provide additional or different license terms and conditions
|
may provide additional or different license terms and conditions
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
the conditions stated in this License.
|
the conditions stated in this License.
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
this License, without any additional terms or conditions.
|
this License, without any additional terms or conditions.
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
the terms of any separate license agreement you may have executed
|
the terms of any separate license agreement you may have executed
|
||||||
with Licensor regarding such Contributions.
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
except as required for reasonable and customary use in describing the
|
except as required for reasonable and customary use in describing the
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
implied, including, without limitation, any warranties or conditions
|
implied, including, without limitation, any warranties or conditions
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
appropriateness of using or redistributing the Work and assume any
|
appropriateness of using or redistributing the Work and assume any
|
||||||
risks associated with Your exercise of permissions under this License.
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
unless required by applicable law (such as deliberate and grossly
|
unless required by applicable law (such as deliberate and grossly
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
liable to You for damages, including any direct, indirect, special,
|
liable to You for damages, including any direct, indirect, special,
|
||||||
incidental, or consequential damages of any character arising as a
|
incidental, or consequential damages of any character arising as a
|
||||||
result of this License or out of the use or inability to use the
|
result of this License or out of the use or inability to use the
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
other commercial damages or losses), even if such Contributor
|
other commercial damages or losses), even if such Contributor
|
||||||
has been advised of the possibility of such damages.
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
or other liability obligations and/or rights consistent with this
|
or other liability obligations and/or rights consistent with this
|
||||||
License. However, in accepting such obligations, You may act only
|
License. However, in accepting such obligations, You may act only
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
defend, and hold each Contributor harmless for any liability
|
defend, and hold each Contributor harmless for any liability
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
To apply the Apache License to your work, attach the following
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
replaced with your own identifying information. (Don't include
|
replaced with your own identifying information. (Don't include
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
comment syntax for the file format. We also recommend that a
|
comment syntax for the file format. We also recommend that a
|
||||||
file or class name and description of purpose be included on the
|
file or class name and description of purpose be included on the
|
||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
@ -1,202 +1,202 @@
|
|||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
1. Definitions.
|
1. Definitions.
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
the copyright owner that is granting the License.
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
other entities that control, are controlled by, or are under common
|
other entities that control, are controlled by, or are under common
|
||||||
control with that entity. For the purposes of this definition,
|
control with that entity. For the purposes of this definition,
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
direction or management of such entity, whether by contract or
|
direction or management of such entity, whether by contract or
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
exercising permissions granted by this License.
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
including but not limited to software source code, documentation
|
including but not limited to software source code, documentation
|
||||||
source, and configuration files.
|
source, and configuration files.
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
"Object" form shall mean any form resulting from mechanical
|
||||||
transformation or translation of a Source form, including but
|
transformation or translation of a Source form, including but
|
||||||
not limited to compiled object code, generated documentation,
|
not limited to compiled object code, generated documentation,
|
||||||
and conversions to other media types.
|
and conversions to other media types.
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
Object form, made available under the License, as indicated by a
|
Object form, made available under the License, as indicated by a
|
||||||
copyright notice that is included in or attached to the work
|
copyright notice that is included in or attached to the work
|
||||||
(an example is provided in the Appendix below).
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
form, that is based on (or derived from) the Work and for which the
|
form, that is based on (or derived from) the Work and for which the
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
of this License, Derivative Works shall not include works that remain
|
of this License, Derivative Works shall not include works that remain
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
the Work and Derivative Works thereof.
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
"Contribution" shall mean any work of authorship, including
|
||||||
the original version of the Work and any modifications or additions
|
the original version of the Work and any modifications or additions
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
means any form of electronic, verbal, or written communication sent
|
means any form of electronic, verbal, or written communication sent
|
||||||
to the Licensor or its representatives, including but not limited to
|
to the Licensor or its representatives, including but not limited to
|
||||||
communication on electronic mailing lists, source code control systems,
|
communication on electronic mailing lists, source code control systems,
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
excluding communication that is conspicuously marked or otherwise
|
excluding communication that is conspicuously marked or otherwise
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
subsequently incorporated within the Work.
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
Work and such Derivative Works in Source or Object form.
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
(except as stated in this section) patent license to make, have made,
|
(except as stated in this section) patent license to make, have made,
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
where such license applies only to those patent claims licensable
|
where such license applies only to those patent claims licensable
|
||||||
by such Contributor that are necessarily infringed by their
|
by such Contributor that are necessarily infringed by their
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
institute patent litigation against any entity (including a
|
institute patent litigation against any entity (including a
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
or contributory patent infringement, then any patent licenses
|
or contributory patent infringement, then any patent licenses
|
||||||
granted to You under this License for that Work shall terminate
|
granted to You under this License for that Work shall terminate
|
||||||
as of the date such litigation is filed.
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
modifications, and in Source or Object form, provided that You
|
modifications, and in Source or Object form, provided that You
|
||||||
meet the following conditions:
|
meet the following conditions:
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
(a) You must give any other recipients of the Work or
|
||||||
Derivative Works a copy of this License; and
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
(b) You must cause any modified files to carry prominent notices
|
||||||
stating that You changed the files; and
|
stating that You changed the files; and
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
that You distribute, all copyright, patent, trademark, and
|
that You distribute, all copyright, patent, trademark, and
|
||||||
attribution notices from the Source form of the Work,
|
attribution notices from the Source form of the Work,
|
||||||
excluding those notices that do not pertain to any part of
|
excluding those notices that do not pertain to any part of
|
||||||
the Derivative Works; and
|
the Derivative Works; and
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
distribution, then any Derivative Works that You distribute must
|
distribution, then any Derivative Works that You distribute must
|
||||||
include a readable copy of the attribution notices contained
|
include a readable copy of the attribution notices contained
|
||||||
within such NOTICE file, excluding those notices that do not
|
within such NOTICE file, excluding those notices that do not
|
||||||
pertain to any part of the Derivative Works, in at least one
|
pertain to any part of the Derivative Works, in at least one
|
||||||
of the following places: within a NOTICE text file distributed
|
of the following places: within a NOTICE text file distributed
|
||||||
as part of the Derivative Works; within the Source form or
|
as part of the Derivative Works; within the Source form or
|
||||||
documentation, if provided along with the Derivative Works; or,
|
documentation, if provided along with the Derivative Works; or,
|
||||||
within a display generated by the Derivative Works, if and
|
within a display generated by the Derivative Works, if and
|
||||||
wherever such third-party notices normally appear. The contents
|
wherever such third-party notices normally appear. The contents
|
||||||
of the NOTICE file are for informational purposes only and
|
of the NOTICE file are for informational purposes only and
|
||||||
do not modify the License. You may add Your own attribution
|
do not modify the License. You may add Your own attribution
|
||||||
notices within Derivative Works that You distribute, alongside
|
notices within Derivative Works that You distribute, alongside
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
that such additional attribution notices cannot be construed
|
that such additional attribution notices cannot be construed
|
||||||
as modifying the License.
|
as modifying the License.
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
You may add Your own copyright statement to Your modifications and
|
||||||
may provide additional or different license terms and conditions
|
may provide additional or different license terms and conditions
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
the conditions stated in this License.
|
the conditions stated in this License.
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
this License, without any additional terms or conditions.
|
this License, without any additional terms or conditions.
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
the terms of any separate license agreement you may have executed
|
the terms of any separate license agreement you may have executed
|
||||||
with Licensor regarding such Contributions.
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
except as required for reasonable and customary use in describing the
|
except as required for reasonable and customary use in describing the
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
implied, including, without limitation, any warranties or conditions
|
implied, including, without limitation, any warranties or conditions
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
appropriateness of using or redistributing the Work and assume any
|
appropriateness of using or redistributing the Work and assume any
|
||||||
risks associated with Your exercise of permissions under this License.
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
unless required by applicable law (such as deliberate and grossly
|
unless required by applicable law (such as deliberate and grossly
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
liable to You for damages, including any direct, indirect, special,
|
liable to You for damages, including any direct, indirect, special,
|
||||||
incidental, or consequential damages of any character arising as a
|
incidental, or consequential damages of any character arising as a
|
||||||
result of this License or out of the use or inability to use the
|
result of this License or out of the use or inability to use the
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
other commercial damages or losses), even if such Contributor
|
other commercial damages or losses), even if such Contributor
|
||||||
has been advised of the possibility of such damages.
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
or other liability obligations and/or rights consistent with this
|
or other liability obligations and/or rights consistent with this
|
||||||
License. However, in accepting such obligations, You may act only
|
License. However, in accepting such obligations, You may act only
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
defend, and hold each Contributor harmless for any liability
|
defend, and hold each Contributor harmless for any liability
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
To apply the Apache License to your work, attach the following
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
replaced with your own identifying information. (Don't include
|
replaced with your own identifying information. (Don't include
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
comment syntax for the file format. We also recommend that a
|
comment syntax for the file format. We also recommend that a
|
||||||
file or class name and description of purpose be included on the
|
file or class name and description of purpose be included on the
|
||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Trezor Dialog Designer</title>
|
<title>Trezor Dialog Designer</title>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<table>
|
<table>
|
||||||
|
@ -80,7 +80,7 @@ aligned_array(unsigned long, dec_hybrid_table, 12, 16) = NEH_DEC_HYBRID_DATA;
|
|||||||
#elif NEH_KEY_TYPE == NEH_HYBRID
|
#elif NEH_KEY_TYPE == NEH_HYBRID
|
||||||
#define kd_adr(c) ((uint8_t*)(c)->ks + ((c)->inf.b[0] == 160 ? 160 : 0))
|
#define kd_adr(c) ((uint8_t*)(c)->ks + ((c)->inf.b[0] == 160 ? 160 : 0))
|
||||||
#else
|
#else
|
||||||
#error no key type defined for VIA ACE
|
#error no key type defined for VIA ACE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -117,7 +117,7 @@ AES_RETURN aes_test_alignment_detection(unsigned int n) /* 4 <= n <= 16 */
|
|||||||
{
|
{
|
||||||
uint8_t *qf = ALIGN_FLOOR(p + i, n),
|
uint8_t *qf = ALIGN_FLOOR(p + i, n),
|
||||||
*qh = ALIGN_CEIL(p + i, n);
|
*qh = ALIGN_CEIL(p + i, n);
|
||||||
|
|
||||||
if(qh == qf)
|
if(qh == qf)
|
||||||
++count_eq;
|
++count_eq;
|
||||||
else if(qh == qf + n)
|
else if(qh == qf + n)
|
||||||
|
@ -193,7 +193,7 @@ Issue Date: 20/12/2007
|
|||||||
assembler code will be used with an AESNI build, if it is then
|
assembler code will be used with an AESNI build, if it is then
|
||||||
AES_REV_DKS must NOT be defined when the assembler files are
|
AES_REV_DKS must NOT be defined when the assembler files are
|
||||||
built (the definition of USE_INTEL_AES_IF_PRESENT in the assembler
|
built (the definition of USE_INTEL_AES_IF_PRESENT in the assembler
|
||||||
code files must match that here if they are used).
|
code files must match that here if they are used).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0 && defined( INTEL_AES_POSSIBLE ) && !defined( USE_INTEL_AES_IF_PRESENT )
|
#if 0 && defined( INTEL_AES_POSSIBLE ) && !defined( USE_INTEL_AES_IF_PRESENT )
|
||||||
|
@ -383,7 +383,7 @@ AES_RETURN aes_init(void)
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Automatic code initialisation (suggested by by Henrik S. Gaßmann)
|
Automatic code initialisation (suggested by by Henrik S. Gaßmann)
|
||||||
based on code provided by Joe Lowe and placed in the public domain at:
|
based on code provided by Joe Lowe and placed in the public domain at:
|
||||||
http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
|
http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
|
||||||
|
@ -58,7 +58,7 @@ void out_state(long s0, long s1, long s2, long s3)
|
|||||||
|
|
||||||
void oblk(char m[], unsigned char v[], unsigned long n)
|
void oblk(char m[], unsigned char v[], unsigned long n)
|
||||||
{ unsigned long i;
|
{ unsigned long i;
|
||||||
|
|
||||||
printf("\n%s", m);
|
printf("\n%s", m);
|
||||||
|
|
||||||
for(i = 0; i < n; ++i)
|
for(i = 0; i < n; ++i)
|
||||||
|
@ -646,9 +646,9 @@ void bn_multiply_reduce_step(uint32_t res[2 * BN_LIMBS], const bignum256 *prime,
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
// acc == 1 << shift
|
// acc == 1 << shift
|
||||||
// Proof:
|
// Proof:
|
||||||
// acc
|
// acc
|
||||||
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + res[d : d + LIMBS + 1] - coef * prime[:LIMBS] >> BITS_PER_LIMB * (LIMBS + 1)
|
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + res[d : d + LIMBS + 1] - coef * prime[:LIMBS] >> BITS_PER_LIMB * (LIMBS + 1)
|
||||||
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + res[d : d + LIMBS + 1] - coef * prime >> BITS_PER_LIMB * (LIMBS + 1)
|
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + res[d : d + LIMBS + 1] - coef * prime >> BITS_PER_LIMB * (LIMBS + 1)
|
||||||
|
|
||||||
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + (res[d : d + LIMBS + 1] - coef * prime) >> BITS_PER_LIMB * (LIMBS + 1)
|
// == (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + (res[d : d + LIMBS + 1] - coef * prime) >> BITS_PER_LIMB * (LIMBS + 1)
|
||||||
// <= (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + (res[:d] + BASE**d * res[d : d + LIMBS + 1] - BASE**d * coef * prime)//BASE**d >> BITS_PER_LIMB * (LIMBS + 1)
|
// <= (1 << BITS_PER_LIMB * (LIMBS + 1) + shift) + (res[:d] + BASE**d * res[d : d + LIMBS + 1] - BASE**d * coef * prime)//BASE**d >> BITS_PER_LIMB * (LIMBS + 1)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
/* Guess the endianness of the target architecture. */
|
/* Guess the endianness of the target architecture. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The LITTLE endian machines:
|
* The LITTLE endian machines:
|
||||||
*/
|
*/
|
||||||
#if defined(__ultrix) /* Older MIPS */
|
#if defined(__ultrix) /* Older MIPS */
|
||||||
@ -29,8 +29,8 @@
|
|||||||
#elif defined(__INTEL_COMPILER) /* x86 (surely Intel compiler icl.exe) */
|
#elif defined(__INTEL_COMPILER) /* x86 (surely Intel compiler icl.exe) */
|
||||||
#define ECRYPT_LITTLE_ENDIAN
|
#define ECRYPT_LITTLE_ENDIAN
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The BIG endian machines:
|
* The BIG endian machines:
|
||||||
*/
|
*/
|
||||||
#elif defined(__sparc) /* Newer Sparc's */
|
#elif defined(__sparc) /* Newer Sparc's */
|
||||||
#define ECRYPT_BIG_ENDIAN
|
#define ECRYPT_BIG_ENDIAN
|
||||||
@ -41,7 +41,7 @@
|
|||||||
#elif defined(__hppa) /* HP-PA */
|
#elif defined(__hppa) /* HP-PA */
|
||||||
#define ECRYPT_BIG_ENDIAN
|
#define ECRYPT_BIG_ENDIAN
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finally machines with UNKNOWN endianness:
|
* Finally machines with UNKNOWN endianness:
|
||||||
*/
|
*/
|
||||||
#elif defined (_AIX) /* RS6000 */
|
#elif defined (_AIX) /* RS6000 */
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* and should be used carefully. They should NOT be used with
|
* and should be used carefully. They should NOT be used with
|
||||||
* parameters which perform some action. E.g., the following two lines
|
* parameters which perform some action. E.g., the following two lines
|
||||||
* are not equivalent:
|
* are not equivalent:
|
||||||
*
|
*
|
||||||
* 1) ++x; y = ROTL32(x, n);
|
* 1) ++x; y = ROTL32(x, n);
|
||||||
* 2) y = ROTL32(++x, n);
|
* 2) y = ROTL32(++x, n);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
#define ECRYPT_API
|
#define ECRYPT_API
|
||||||
/* ecrypt-sync.h */
|
/* ecrypt-sync.h */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Header file for synchronous stream ciphers without authentication
|
* Header file for synchronous stream ciphers without authentication
|
||||||
* mechanism.
|
* mechanism.
|
||||||
*
|
*
|
||||||
* *** Please only edit parts marked with "[edit]". ***
|
* *** Please only edit parts marked with "[edit]". ***
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/* Cipher parameters */
|
/* Cipher parameters */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of your cipher.
|
* The name of your cipher.
|
||||||
*/
|
*/
|
||||||
#define ECRYPT_NAME "ChaCha20"
|
#define ECRYPT_NAME "ChaCha20"
|
||||||
@ -49,15 +49,15 @@
|
|||||||
|
|
||||||
/* Data structures */
|
/* Data structures */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ECRYPT_ctx is the structure containing the representation of the
|
* ECRYPT_ctx is the structure containing the representation of the
|
||||||
* internal state of your cipher.
|
* internal state of your cipher.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
u32 input[16]; /* could be compressed */
|
u32 input[16]; /* could be compressed */
|
||||||
/*
|
/*
|
||||||
* [edit]
|
* [edit]
|
||||||
*
|
*
|
||||||
* Put here all state variable needed during the encryption process.
|
* Put here all state variable needed during the encryption process.
|
||||||
@ -81,10 +81,10 @@ void ECRYPT_init(void);
|
|||||||
* above.
|
* above.
|
||||||
*/
|
*/
|
||||||
void ECRYPT_keysetup(
|
void ECRYPT_keysetup(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* key,
|
const u8* key,
|
||||||
u32 keysize, /* Key size in bits. */
|
u32 keysize, /* Key size in bits. */
|
||||||
u32 ivsize); /* IV size in bits. */
|
u32 ivsize); /* IV size in bits. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IV setup. After having called ECRYPT_keysetup(), the user is
|
* IV setup. After having called ECRYPT_keysetup(), the user is
|
||||||
@ -93,7 +93,7 @@ void ECRYPT_keysetup(
|
|||||||
* IV's.
|
* IV's.
|
||||||
*/
|
*/
|
||||||
void ECRYPT_ivsetup(
|
void ECRYPT_ivsetup(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* iv);
|
const u8* iv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -104,7 +104,7 @@ void ECRYPT_ivsetup(
|
|||||||
* (declared here) encrypts byte strings of arbitrary length, while
|
* (declared here) encrypts byte strings of arbitrary length, while
|
||||||
* the ECRYPT_encrypt_blocks() function (defined later) only accepts
|
* the ECRYPT_encrypt_blocks() function (defined later) only accepts
|
||||||
* lengths which are multiples of ECRYPT_BLOCKLENGTH.
|
* lengths which are multiples of ECRYPT_BLOCKLENGTH.
|
||||||
*
|
*
|
||||||
* The user is allowed to make multiple calls to
|
* The user is allowed to make multiple calls to
|
||||||
* ECRYPT_encrypt_blocks() to incrementally encrypt a long message,
|
* ECRYPT_encrypt_blocks() to incrementally encrypt a long message,
|
||||||
* but he is NOT allowed to make additional encryption calls once he
|
* but he is NOT allowed to make additional encryption calls once he
|
||||||
@ -124,7 +124,7 @@ void ECRYPT_ivsetup(
|
|||||||
*
|
*
|
||||||
* ECRYPT_ivsetup();
|
* ECRYPT_ivsetup();
|
||||||
* ECRYPT_encrypt_bytes();
|
* ECRYPT_encrypt_bytes();
|
||||||
*
|
*
|
||||||
* The following sequence is not:
|
* The following sequence is not:
|
||||||
*
|
*
|
||||||
* ECRYPT_keysetup();
|
* ECRYPT_keysetup();
|
||||||
@ -135,22 +135,22 @@ void ECRYPT_ivsetup(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void ECRYPT_encrypt_bytes(
|
void ECRYPT_encrypt_bytes(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* plaintext,
|
const u8* plaintext,
|
||||||
u8* ciphertext,
|
u8* ciphertext,
|
||||||
u32 msglen); /* Message length in bytes. */
|
u32 msglen); /* Message length in bytes. */
|
||||||
|
|
||||||
void ECRYPT_decrypt_bytes(
|
void ECRYPT_decrypt_bytes(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* ciphertext,
|
const u8* ciphertext,
|
||||||
u8* plaintext,
|
u8* plaintext,
|
||||||
u32 msglen); /* Message length in bytes. */
|
u32 msglen); /* Message length in bytes. */
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* Optional features */
|
/* Optional features */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For testing purposes it can sometimes be useful to have a function
|
* For testing purposes it can sometimes be useful to have a function
|
||||||
* which immediately generates keystream without having to provide it
|
* which immediately generates keystream without having to provide it
|
||||||
* with a zero plaintext. If your cipher cannot provide this function
|
* with a zero plaintext. If your cipher cannot provide this function
|
||||||
@ -172,7 +172,7 @@ void ECRYPT_keystream_bytes(
|
|||||||
|
|
||||||
/* Optional optimizations */
|
/* Optional optimizations */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* By default, the functions in this section are implemented using
|
* By default, the functions in this section are implemented using
|
||||||
* calls to functions declared above. However, you might want to
|
* calls to functions declared above. However, you might want to
|
||||||
* implement them differently for performance reasons.
|
* implement them differently for performance reasons.
|
||||||
@ -188,22 +188,22 @@ void ECRYPT_keystream_bytes(
|
|||||||
#define ECRYPT_USES_DEFAULT_ALL_IN_ONE /* [edit] */
|
#define ECRYPT_USES_DEFAULT_ALL_IN_ONE /* [edit] */
|
||||||
|
|
||||||
void ECRYPT_encrypt_packet(
|
void ECRYPT_encrypt_packet(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* iv,
|
const u8* iv,
|
||||||
const u8* plaintext,
|
const u8* plaintext,
|
||||||
u8* ciphertext,
|
u8* ciphertext,
|
||||||
u32 msglen);
|
u32 msglen);
|
||||||
|
|
||||||
void ECRYPT_decrypt_packet(
|
void ECRYPT_decrypt_packet(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* iv,
|
const u8* iv,
|
||||||
const u8* ciphertext,
|
const u8* ciphertext,
|
||||||
u8* plaintext,
|
u8* plaintext,
|
||||||
u32 msglen);
|
u32 msglen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Encryption/decryption of blocks.
|
* Encryption/decryption of blocks.
|
||||||
*
|
*
|
||||||
* By default, these functions are defined as macros. If you want to
|
* By default, these functions are defined as macros. If you want to
|
||||||
* provide a different implementation, please undef the
|
* provide a different implementation, please undef the
|
||||||
* ECRYPT_USES_DEFAULT_BLOCK_MACROS flag and implement the functions
|
* ECRYPT_USES_DEFAULT_BLOCK_MACROS flag and implement the functions
|
||||||
@ -234,23 +234,23 @@ void ECRYPT_decrypt_packet(
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
void ECRYPT_encrypt_blocks(
|
void ECRYPT_encrypt_blocks(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* plaintext,
|
const u8* plaintext,
|
||||||
u8* ciphertext,
|
u8* ciphertext,
|
||||||
u32 blocks); /* Message length in blocks. */
|
u32 blocks); /* Message length in blocks. */
|
||||||
|
|
||||||
void ECRYPT_decrypt_blocks(
|
void ECRYPT_decrypt_blocks(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* ciphertext,
|
const u8* ciphertext,
|
||||||
u8* plaintext,
|
u8* plaintext,
|
||||||
u32 blocks); /* Message length in blocks. */
|
u32 blocks); /* Message length in blocks. */
|
||||||
|
|
||||||
#ifdef ECRYPT_GENERATES_KEYSTREAM
|
#ifdef ECRYPT_GENERATES_KEYSTREAM
|
||||||
|
|
||||||
void ECRYPT_keystream_blocks(
|
void ECRYPT_keystream_blocks(
|
||||||
ECRYPT_ctx* ctx,
|
ECRYPT_ctx* ctx,
|
||||||
const u8* keystream,
|
const u8* keystream,
|
||||||
u32 blocks); /* Keystream length in blocks. */
|
u32 blocks); /* Keystream length in blocks. */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ void ECRYPT_keystream_blocks(
|
|||||||
* significant difference and keep the number of variants
|
* significant difference and keep the number of variants
|
||||||
* (ECRYPT_MAXVARIANT) as small as possible (definitely not more than
|
* (ECRYPT_MAXVARIANT) as small as possible (definitely not more than
|
||||||
* 10). Note also that all variants should have exactly the same
|
* 10). Note also that all variants should have exactly the same
|
||||||
* external interface (i.e., the same ECRYPT_BLOCKLENGTH, etc.).
|
* external interface (i.e., the same ECRYPT_BLOCKLENGTH, etc.).
|
||||||
*/
|
*/
|
||||||
#define ECRYPT_MAXVARIANT 1 /* [edit] */
|
#define ECRYPT_MAXVARIANT 1 /* [edit] */
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
[ed25519](https://ed25519.cr.yp.to) is an
|
[ed25519](https://ed25519.cr.yp.to) is an
|
||||||
[Elliptic Curve Digital Signature Algortithm](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm),
|
[Elliptic Curve Digital Signature Algortithm](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm),
|
||||||
developed by [Dan Bernstein](https://cr.yp.to/djb.html),
|
developed by [Dan Bernstein](https://cr.yp.to/djb.html),
|
||||||
[Niels Duif](https://www.nielsduif.nl),
|
[Niels Duif](https://www.nielsduif.nl),
|
||||||
[Tanja Lange](https://hyperelliptic.org/tanja),
|
[Tanja Lange](https://hyperelliptic.org/tanja),
|
||||||
[Peter Schwabe](https://cryptojedi.org/peter),
|
[Peter Schwabe](https://cryptojedi.org/peter),
|
||||||
and [Bo-Yin Yang](https://www.iis.sinica.edu.tw/pages/byyang).
|
and [Bo-Yin Yang](https://www.iis.sinica.edu.tw/pages/byyang).
|
||||||
|
|
||||||
This project provides performant, portable 32-bit & 64-bit implementations. All implementations are
|
This project provides performant, portable 32-bit & 64-bit implementations. All implementations are
|
||||||
of course constant time in regard to secret data.
|
of course constant time in regard to secret data.
|
||||||
|
|
||||||
#### Performance
|
#### Performance
|
||||||
@ -52,16 +52,16 @@ are made.
|
|||||||
|
|
||||||
#### Compilation
|
#### Compilation
|
||||||
|
|
||||||
No configuration is needed **if you are compiling against OpenSSL**.
|
No configuration is needed **if you are compiling against OpenSSL**.
|
||||||
|
|
||||||
##### Hash Options
|
##### Hash Options
|
||||||
|
|
||||||
If you are not compiling aginst OpenSSL, you will need a hash function.
|
If you are not compiling aginst OpenSSL, you will need a hash function.
|
||||||
|
|
||||||
To use a simple/**slow** implementation of SHA-512, use `-DED25519_REFHASH` when compiling `ed25519.c`.
|
To use a simple/**slow** implementation of SHA-512, use `-DED25519_REFHASH` when compiling `ed25519.c`.
|
||||||
This should never be used except to verify the code works when OpenSSL is not available.
|
This should never be used except to verify the code works when OpenSSL is not available.
|
||||||
|
|
||||||
To use a custom hash function, use `-DED25519_CUSTOMHASH` when compiling `ed25519.c` and put your
|
To use a custom hash function, use `-DED25519_CUSTOMHASH` when compiling `ed25519.c` and put your
|
||||||
custom hash implementation in ed25519-hash-custom.h. The hash must have a 512bit digest and implement
|
custom hash implementation in ed25519-hash-custom.h. The hash must have a 512bit digest and implement
|
||||||
|
|
||||||
struct ed25519_hash_context;
|
struct ed25519_hash_context;
|
||||||
@ -75,12 +75,12 @@ custom hash implementation in ed25519-hash-custom.h. The hash must have a 512bit
|
|||||||
|
|
||||||
If you are not compiling aginst OpenSSL, you will need a random function for batch verification.
|
If you are not compiling aginst OpenSSL, you will need a random function for batch verification.
|
||||||
|
|
||||||
To use a custom random function, use `-DED25519_CUSTOMRANDOM` when compiling `ed25519.c` and put your
|
To use a custom random function, use `-DED25519_CUSTOMRANDOM` when compiling `ed25519.c` and put your
|
||||||
custom hash implementation in ed25519-randombytes-custom.h. The random function must implement:
|
custom hash implementation in ed25519-randombytes-custom.h. The random function must implement:
|
||||||
|
|
||||||
void ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len);
|
void ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len);
|
||||||
|
|
||||||
Use `-DED25519_TEST` when compiling `ed25519.c` to use a deterministically seeded, non-thread safe CSPRNG
|
Use `-DED25519_TEST` when compiling `ed25519.c` to use a deterministically seeded, non-thread safe CSPRNG
|
||||||
variant of Bob Jenkins [ISAAC](https://en.wikipedia.org/wiki/ISAAC_%28cipher%29)
|
variant of Bob Jenkins [ISAAC](https://en.wikipedia.org/wiki/ISAAC_%28cipher%29)
|
||||||
|
|
||||||
##### Minor options
|
##### Minor options
|
||||||
@ -144,27 +144,27 @@ To batch verify signatures:
|
|||||||
/* valid[i] will be set to 1 if the individual signature was valid, 0 otherwise */
|
/* valid[i] will be set to 1 if the individual signature was valid, 0 otherwise */
|
||||||
int all_valid = ed25519_sign_open_batch(mp, ml, pkp, sigp, num, valid) == 0;
|
int all_valid = ed25519_sign_open_batch(mp, ml, pkp, sigp, num, valid) == 0;
|
||||||
|
|
||||||
**Note**: Batch verification uses `ed25519_randombytes_unsafe`, implemented in
|
**Note**: Batch verification uses `ed25519_randombytes_unsafe`, implemented in
|
||||||
`ed25519-randombytes.h`, to generate random scalars for the verification code.
|
`ed25519-randombytes.h`, to generate random scalars for the verification code.
|
||||||
The default implementation now uses OpenSSLs `RAND_bytes`.
|
The default implementation now uses OpenSSLs `RAND_bytes`.
|
||||||
|
|
||||||
Unlike the [SUPERCOP](https://bench.cr.yp.to/supercop.html) version, signatures are
|
Unlike the [SUPERCOP](https://bench.cr.yp.to/supercop.html) version, signatures are
|
||||||
not appended to messages, and there is no need for padding in front of messages.
|
not appended to messages, and there is no need for padding in front of messages.
|
||||||
Additionally, the secret key does not contain a copy of the public key, so it is
|
Additionally, the secret key does not contain a copy of the public key, so it is
|
||||||
32 bytes instead of 64 bytes, and the public key must be provided to the signing
|
32 bytes instead of 64 bytes, and the public key must be provided to the signing
|
||||||
function.
|
function.
|
||||||
|
|
||||||
##### Curve25519
|
##### Curve25519
|
||||||
|
|
||||||
Curve25519 public keys can be generated thanks to
|
Curve25519 public keys can be generated thanks to
|
||||||
[Adam Langley](https://www.imperialviolet.org/2013/05/10/fastercurve25519.html)
|
[Adam Langley](https://www.imperialviolet.org/2013/05/10/fastercurve25519.html)
|
||||||
leveraging Ed25519's precomputed basepoint scalar multiplication.
|
leveraging Ed25519's precomputed basepoint scalar multiplication.
|
||||||
|
|
||||||
curved25519_key sk, pk;
|
curved25519_key sk, pk;
|
||||||
randombytes(sk, sizeof(curved25519_key));
|
randombytes(sk, sizeof(curved25519_key));
|
||||||
curved25519_scalarmult_basepoint(pk, sk);
|
curved25519_scalarmult_basepoint(pk, sk);
|
||||||
|
|
||||||
Note the name is curved25519, a combination of curve and ed25519, to prevent
|
Note the name is curved25519, a combination of curve and ed25519, to prevent
|
||||||
name clashes. Performance is slightly faster than short message ed25519
|
name clashes. Performance is slightly faster than short message ed25519
|
||||||
signing due to both using the same code for the scalar multiply.
|
signing due to both using the same code for the scalar multiply.
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ void ge25519_double_scalarmult_vartime2(ge25519 *r, const ge25519 *p1, const big
|
|||||||
ge25519_full_to_pniels(pre2, p2);
|
ge25519_full_to_pniels(pre2, p2);
|
||||||
for (i = 0; i < S1_TABLE_SIZE - 1; i++)
|
for (i = 0; i < S1_TABLE_SIZE - 1; i++)
|
||||||
ge25519_pnielsadd(&pre2[i+1], &dp, &pre2[i]);
|
ge25519_pnielsadd(&pre2[i+1], &dp, &pre2[i]);
|
||||||
|
|
||||||
ge25519_set_neutral(r);
|
ge25519_set_neutral(r);
|
||||||
|
|
||||||
i = 255;
|
i = 255;
|
||||||
@ -520,7 +520,7 @@ void ge25519_scalarmult_base_niels(ge25519 *r, const uint8_t basepoint_table[256
|
|||||||
curve25519_add_reduce(r->y, t.xaddy, t.ysubx);
|
curve25519_add_reduce(r->y, t.xaddy, t.ysubx);
|
||||||
memzero(r->z, sizeof(bignum25519));
|
memzero(r->z, sizeof(bignum25519));
|
||||||
curve25519_copy(r->t, t.t2d);
|
curve25519_copy(r->t, t.t2d);
|
||||||
r->z[0] = 2;
|
r->z[0] = 2;
|
||||||
for (i = 3; i < 64; i += 2) {
|
for (i = 3; i < 64; i += 2) {
|
||||||
ge25519_scalarmult_base_choose_niels(&t, basepoint_table, i / 2, b[i]);
|
ge25519_scalarmult_base_choose_niels(&t, basepoint_table, i / 2, b[i]);
|
||||||
ge25519_nielsadd2(r, &t);
|
ge25519_nielsadd2(r, &t);
|
||||||
|
@ -142,7 +142,7 @@ ED25519_FN(ed25519_sign_ext) (const unsigned char *m, size_t mlen, const ed25519
|
|||||||
hash_512bits extsk = {0}, hashr = {0}, hram = {0};
|
hash_512bits extsk = {0}, hashr = {0}, hram = {0};
|
||||||
|
|
||||||
/* we don't stretch the key through hashing first since its already 64 bytes */
|
/* we don't stretch the key through hashing first since its already 64 bytes */
|
||||||
|
|
||||||
memcpy(extsk, sk, 32);
|
memcpy(extsk, sk, 32);
|
||||||
memcpy(extsk+32, skext, 32);
|
memcpy(extsk+32, skext, 32);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* ==========================(LICENSE BEGIN)============================
|
* ==========================(LICENSE BEGIN)============================
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
|
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
* "Software"), to deal in the Software without restriction, including
|
* "Software"), to deal in the Software without restriction, including
|
||||||
@ -15,10 +15,10 @@
|
|||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
* the following conditions:
|
* the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be
|
* The above copyright notice and this permission notice shall be
|
||||||
* included in all copies or substantial portions of the Software.
|
* included in all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* ==========================(LICENSE BEGIN)============================
|
* ==========================(LICENSE BEGIN)============================
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
|
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
* "Software"), to deal in the Software without restriction, including
|
* "Software"), to deal in the Software without restriction, including
|
||||||
@ -27,10 +27,10 @@
|
|||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
* the following conditions:
|
* the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be
|
* The above copyright notice and this permission notice shall be
|
||||||
* included in all copies or substantial portions of the Software.
|
* included in all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2014-2018, The Monero Project
|
// Copyright (c) 2014-2018, The Monero Project
|
||||||
//
|
//
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification, are
|
// Redistribution and use in source and binary forms, with or without modification, are
|
||||||
// permitted provided that the following conditions are met:
|
// permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
// conditions and the following disclaimer.
|
// conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
// of conditions and the following disclaimer in the documentation and/or other
|
// of conditions and the following disclaimer in the documentation and/or other
|
||||||
// materials provided with the distribution.
|
// materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||||
// used to endorse or promote products derived from this software without specific
|
// used to endorse or promote products derived from this software without specific
|
||||||
// prior written permission.
|
// prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
@ -25,7 +25,7 @@
|
|||||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2014-2018, The Monero Project
|
// Copyright (c) 2014-2018, The Monero Project
|
||||||
//
|
//
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification, are
|
// Redistribution and use in source and binary forms, with or without modification, are
|
||||||
// permitted provided that the following conditions are met:
|
// permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
// conditions and the following disclaimer.
|
// conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
// of conditions and the following disclaimer in the documentation and/or other
|
// of conditions and the following disclaimer in the documentation and/or other
|
||||||
// materials provided with the distribution.
|
// materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||||
// used to endorse or promote products derived from this software without specific
|
// used to endorse or promote products derived from this software without specific
|
||||||
// prior written permission.
|
// prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
@ -25,7 +25,7 @@
|
|||||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||||
|
|
||||||
#ifndef __XMR_BASE58_H__
|
#ifndef __XMR_BASE58_H__
|
||||||
@ -40,4 +40,4 @@ int xmr_base58_addr_decode_check(const char *addr, size_t sz, uint64_t *tag, voi
|
|||||||
bool xmr_base58_encode(char *b58, size_t *b58sz, const void *data, size_t binsz);
|
bool xmr_base58_encode(char *b58, size_t *b58sz, const void *data, size_t binsz);
|
||||||
bool xmr_base58_decode(const char *b58, size_t b58sz, void *data, size_t *binsz);
|
bool xmr_base58_decode(const char *b58, size_t b58sz, void *data, size_t *binsz);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2014-2018, The Monero Project
|
// Copyright (c) 2014-2018, The Monero Project
|
||||||
//
|
//
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without modification, are
|
// Redistribution and use in source and binary forms, with or without modification, are
|
||||||
// permitted provided that the following conditions are met:
|
// permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
// conditions and the following disclaimer.
|
// conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
// of conditions and the following disclaimer in the documentation and/or other
|
// of conditions and the following disclaimer in the documentation and/or other
|
||||||
// materials provided with the distribution.
|
// materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||||
// used to endorse or promote products derived from this software without specific
|
// used to endorse or promote products derived from this software without specific
|
||||||
// prior written permission.
|
// prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
@ -25,7 +25,7 @@
|
|||||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
*
|
*
|
||||||
* And for little-endian machines, add:
|
* And for little-endian machines, add:
|
||||||
*
|
*
|
||||||
* #define BYTE_ORDER LITTLE_ENDIAN
|
* #define BYTE_ORDER LITTLE_ENDIAN
|
||||||
*
|
*
|
||||||
* Or for big-endian machines:
|
* Or for big-endian machines:
|
||||||
*
|
*
|
||||||
@ -795,7 +795,7 @@ void sha256_Transform(const sha2_word32* state_in, const sha2_word32* data, sha2
|
|||||||
s1 = sigma1_256(s1);
|
s1 = sigma1_256(s1);
|
||||||
|
|
||||||
/* Apply the SHA-256 compression function to update a..h */
|
/* Apply the SHA-256 compression function to update a..h */
|
||||||
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
|
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
|
||||||
(W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
|
(W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
|
||||||
T2 = Sigma0_256(a) + Maj(a, b, c);
|
T2 = Sigma0_256(a) + Maj(a, b, c);
|
||||||
h = g;
|
h = g;
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
The complete test suite is running on a public [GitLab CI](https://gitlab.com/satoshilabs/trezor/trezor-firmware). If you are an external contributor, we also have a [Travis instance](https://travis-ci.org/trezor/trezor-firmware) where a small subset of tests is running as well - mostly style and easy fast checks, which are quite common to fail for new contributors.
|
The complete test suite is running on a public [GitLab CI](https://gitlab.com/satoshilabs/trezor/trezor-firmware). If you are an external contributor, we also have a [Travis instance](https://travis-ci.org/trezor/trezor-firmware) where a small subset of tests is running as well - mostly style and easy fast checks, which are quite common to fail for new contributors.
|
||||||
|
|
||||||
See this [list](jobs.md) of CI jobs descriptions for more info.
|
See this [list](jobs.md) of CI jobs descriptions for more info.
|
||||||
|
|
||||||
The CI folder contains all the .yml GitLab files that are included in the main `.gitlab.yml` to provide some basic structure. All GitLab CI Jobs run inside a docker image, which is built using the present `Dockerfile`. This image is stored in the GitLab registry.
|
The CI folder contains all the .yml GitLab files that are included in the main `.gitlab.yml` to provide some basic structure. All GitLab CI Jobs run inside a docker image, which is built using the present `Dockerfile`. This image is stored in the GitLab registry.
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
### Environment
|
### Environment
|
||||||
|
|
||||||
Environment job builds the `ci/Dockerfile` and pushes the built docker image
|
Environment job builds the `ci/Dockerfile` and pushes the built docker image
|
||||||
into our GitLab registry. Since modifications of this Dockerfile are very rare
|
into our GitLab registry. Since modifications of this Dockerfile are very rare
|
||||||
this si a _manual_ job which needs to be triggered on GitLab.
|
this si a _manual_ job which needs to be triggered on GitLab.
|
||||||
|
|
||||||
Almost all CI jobs run inside this docker image.
|
Almost all CI jobs run inside this docker image.
|
||||||
|
@ -145,5 +145,5 @@ both T1 and TT with both older and newer firmwares.
|
|||||||
of `state` as `stored_session_id`, and respond with `Deprecated_PassphraseStateAck`
|
of `state` as `stored_session_id`, and respond with `Deprecated_PassphraseStateAck`
|
||||||
with no fields set.
|
with no fields set.
|
||||||
|
|
||||||
Note: up to 64 bytes may be required to store the session ID. Firmwares < 2.3.0 use a
|
Note: up to 64 bytes may be required to store the session ID. Firmwares < 2.3.0 use a
|
||||||
64-byte value, newer firmwares use a 32-byte value.
|
64-byte value, newer firmwares use a 32-byte value.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Passphrase
|
# Passphrase
|
||||||
|
|
||||||
As of 1.9.0 / 2.3.0 we have changed how [passphrase](https://wiki.trezor.io/Passphrase) is communicated between the host and the device. For migration information for existing Hosts communicating with Trezor please see this [document](passphrase-redesign-migration.md).
|
As of 1.9.0 / 2.3.0 we have changed how [passphrase](https://wiki.trezor.io/Passphrase) is communicated between the host and the device. For migration information for existing Hosts communicating with Trezor please see this [document](passphrase-redesign-migration.md).
|
||||||
|
|
||||||
Passphrase is very tightly coupled with _sessions_. The reader is encouraged to read on that topic first in the [sessions.md](sessions.md) section.
|
Passphrase is very tightly coupled with _sessions_. The reader is encouraged to read on that topic first in the [sessions.md](sessions.md) section.
|
||||||
|
|
||||||
## Scheme
|
## Scheme
|
||||||
@ -9,11 +9,11 @@ Passphrase is very tightly coupled with _sessions_. The reader is encouraged to
|
|||||||
As soon as Trezor needs the passphrase to do BIP-39/SLIP-39 derivations it prompts the user for passphrase.
|
As soon as Trezor needs the passphrase to do BIP-39/SLIP-39 derivations it prompts the user for passphrase.
|
||||||
|
|
||||||
```
|
```
|
||||||
GetAddress(...)
|
GetAddress(...)
|
||||||
---------> PassphraseRequest()
|
---------> PassphraseRequest()
|
||||||
<---------
|
<---------
|
||||||
PassphraseAck
|
PassphraseAck
|
||||||
(str passphrase, bool on_device)
|
(str passphrase, bool on_device)
|
||||||
---------> Address(...)
|
---------> Address(...)
|
||||||
<---------
|
<---------
|
||||||
```
|
```
|
||||||
@ -30,7 +30,7 @@ On an initialized device with passphrase enabled a common communication starts l
|
|||||||
Initialize()
|
Initialize()
|
||||||
---------> Features(..., session_id)
|
---------> Features(..., session_id)
|
||||||
<---------
|
<---------
|
||||||
GetAddress(...)
|
GetAddress(...)
|
||||||
---------> PassphraseRequest()
|
---------> PassphraseRequest()
|
||||||
<---------
|
<---------
|
||||||
PassphraseAck(...)
|
PassphraseAck(...)
|
||||||
@ -38,7 +38,7 @@ PassphraseAck(...)
|
|||||||
<---------
|
<---------
|
||||||
```
|
```
|
||||||
|
|
||||||
The device requested the passphrase since the BIP-39/SLIP-39 seed is not yet cached. After this workflow the seed is cached and the passphrase will therefore never be requested again unless the session is cleared*.
|
The device requested the passphrase since the BIP-39/SLIP-39 seed is not yet cached. After this workflow the seed is cached and the passphrase will therefore never be requested again unless the session is cleared*.
|
||||||
|
|
||||||
Since we do not have sessions, the Host can not be sure that someone else has not used the device and applied another session id (e.g. changed the Passphrase). To work around this we send the session id again on every subsequent message. See more on that in [session.md]().
|
Since we do not have sessions, the Host can not be sure that someone else has not used the device and applied another session id (e.g. changed the Passphrase). To work around this we send the session id again on every subsequent message. See more on that in [session.md]().
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ Since we do not have sessions, the Host can not be sure that someone else has no
|
|||||||
Initialize(session_id)
|
Initialize(session_id)
|
||||||
---------> Features(..., session_id)
|
---------> Features(..., session_id)
|
||||||
<---------
|
<---------
|
||||||
GetPublicKey(...)
|
GetPublicKey(...)
|
||||||
---------> PublicKey(...)
|
---------> PublicKey(...)
|
||||||
<---------
|
<---------
|
||||||
```
|
```
|
||||||
|
@ -10,6 +10,6 @@ JSON coin definitions and support tables.
|
|||||||
|
|
||||||
Common Protobuf definitions for the Trezor protocol. Also see [Communication](communication/index.md).
|
Common Protobuf definitions for the Trezor protocol. Also see [Communication](communication/index.md).
|
||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
Tools for managing coin definitions and related data.
|
Tools for managing coin definitions and related data.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Build instructions for Emulator (Unix port)
|
# Build instructions for Emulator (Unix port)
|
||||||
|
|
||||||
First clone, initialize submodules, install Poetry and enter the Poetry shell as
|
First clone, initialize submodules, install Poetry and enter the Poetry shell as
|
||||||
defined [here](index.md). **Do not forget you need to be in a `poetry shell`
|
defined [here](index.md). **Do not forget you need to be in a `poetry shell`
|
||||||
environment!**
|
environment!**
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ SLIP-39 provides the following high-level API:
|
|||||||
|
|
||||||
* `generate_mnemonics(group parameters, master_secret, passphrase)`: Encrypt Master
|
* `generate_mnemonics(group parameters, master_secret, passphrase)`: Encrypt Master
|
||||||
Secret with the provided passphrase, and split into a number of shares defined via
|
Secret with the provided passphrase, and split into a number of shares defined via
|
||||||
the group parameters.
|
the group parameters.
|
||||||
Implemented using the following:
|
Implemented using the following:
|
||||||
- `encrypt(master_secret, passphrase, iteration_exponent, identifier)`: Encrypt the
|
- `encrypt(master_secret, passphrase, iteration_exponent, identifier)`: Encrypt the
|
||||||
Master Secret with the given passphrase and parameters.
|
Master Secret with the given passphrase and parameters.
|
||||||
@ -52,7 +52,7 @@ SLIP-39 provides the following high-level API:
|
|||||||
Split the encrypted secret and encode the metadata into a set of shares defined via
|
Split the encrypted secret and encode the metadata into a set of shares defined via
|
||||||
the group parameters.
|
the group parameters.
|
||||||
* `combine_mnemonics(set of shares, passphrase)`: Combine the given set of shares to
|
* `combine_mnemonics(set of shares, passphrase)`: Combine the given set of shares to
|
||||||
reconstruct the secret, then decrypt it with the provided passphrase.
|
reconstruct the secret, then decrypt it with the provided passphrase.
|
||||||
Implemented using the following:
|
Implemented using the following:
|
||||||
- **`recover_ems(set of shares)`**: Combine the given set of shares to obtain the
|
- **`recover_ems(set of shares)`**: Combine the given set of shares to obtain the
|
||||||
encrypted master secret, identifier and iteration exponent.
|
encrypted master secret, identifier and iteration exponent.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
_This documentation can also be found at [docs.trezor.io](https://docs.trezor.io) where it is available in a HTML-built version compiled using [mdBook](https://github.com/rust-lang/mdBook)._
|
_This documentation can also be found at [docs.trezor.io](https://docs.trezor.io) where it is available in a HTML-built version compiled using [mdBook](https://github.com/rust-lang/mdBook)._
|
||||||
|
|
||||||
Welcome to the Trezor Firmware repository. This repository is so called _monorepo_, it contains several different yet very related projects that together form the Trezor Firmware ecosystem.
|
Welcome to the Trezor Firmware repository. This repository is so called _monorepo_, it contains several different yet very related projects that together form the Trezor Firmware ecosystem.
|
||||||
|
|
||||||
## Repository Structure
|
## Repository Structure
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ Step 3 should produce the same fingerprint like your local build (for the same v
|
|||||||
|
|
||||||
**WARNING: This will erase the recovery seed stored on the device! You should never do this on Trezor that contains coins!**
|
**WARNING: This will erase the recovery seed stored on the device! You should never do this on Trezor that contains coins!**
|
||||||
|
|
||||||
Build with `MEMORY_PROTECT=0` or you will get a hard fault on your device.
|
Build with `MEMORY_PROTECT=0` or you will get a hard fault on your device.
|
||||||
|
|
||||||
Switch your device to bootloader mode, then execute:
|
Switch your device to bootloader mode, then execute:
|
||||||
```sh
|
```sh
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
`git commit --fixup [commithash]` which creates a new commit with the message "fixup! [orig_message]",
|
`git commit --fixup [commithash]` which creates a new commit with the message "fixup! [orig_message]",
|
||||||
where orig_message is the commit message of the `commithash` it "fixes". If the fixes are across
|
where orig_message is the commit message of the `commithash` it "fixes". If the fixes are across
|
||||||
multiple earlier commits, then they need to be split into multiple fixup commits.
|
multiple earlier commits, then they need to be split into multiple fixup commits.
|
||||||
5. The author informs the reviewer with a simple comment "done" or similar to tell the reviewer
|
5. The author informs the reviewer with a simple comment "done" or similar to tell the reviewer
|
||||||
their comment was implemented. Bonus points for including a revision of the fixup commit.
|
their comment was implemented. Bonus points for including a revision of the fixup commit.
|
||||||
6. The reviewer reviews the modifications and when they are finally satisfied they resolve the Github
|
6. The reviewer reviews the modifications and when they are finally satisfied they resolve the Github
|
||||||
comment.
|
comment.
|
||||||
@ -35,7 +35,7 @@
|
|||||||
If you find the description too difficult, then here is an example to make it more clear.
|
If you find the description too difficult, then here is an example to make it more clear.
|
||||||
|
|
||||||
Andrew tries to add a number of commits very well structured and with nice and consistent commit
|
Andrew tries to add a number of commits very well structured and with nice and consistent commit
|
||||||
messages. These will _not_ be squashed together.
|
messages. These will _not_ be squashed together.
|
||||||
|
|
||||||
![](review-1.png)
|
![](review-1.png)
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ Matějčík starts to review and finds something he would like to improve:
|
|||||||
|
|
||||||
![](review-2.png)
|
![](review-2.png)
|
||||||
|
|
||||||
Andrew responds with a commit hash 55d883b informing that he has accepted and implemented the
|
Andrew responds with a commit hash 55d883b informing that he has accepted and implemented the
|
||||||
comment.
|
comment.
|
||||||
|
|
||||||
This commit is a fixup commit. Since it is a new commit he does not have to force-push. In the
|
This commit is a fixup commit. Since it is a new commit he does not have to force-push. In the
|
||||||
|
@ -8,7 +8,7 @@ update.
|
|||||||
The device gets **wiped**:
|
The device gets **wiped**:
|
||||||
- If the firmware to be installed is unsigned.
|
- If the firmware to be installed is unsigned.
|
||||||
- If the present firmware is unsigned.
|
- If the present firmware is unsigned.
|
||||||
- If the firmware to be installed has lower version than the current firmware's
|
- If the firmware to be installed has lower version than the current firmware's
|
||||||
_fix_version_ [1].
|
_fix_version_ [1].
|
||||||
|
|
||||||
The device gets **wiped on every reboot**:
|
The device gets **wiped on every reboot**:
|
||||||
@ -41,8 +41,8 @@ The device gets **wiped on every reboot**:
|
|||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
[1] Firmware contains a _fix_version_, which is the lowest version to which that
|
[1] Firmware contains a _fix_version_, which is the lowest version to which that
|
||||||
particular firmware can be downgraded without wiping storage. This is typically used in
|
particular firmware can be downgraded without wiping storage. This is typically used in
|
||||||
case the internal storage format is changed. For example, in version 2.2.0, we have
|
case the internal storage format is changed. For example, in version 2.2.0, we have
|
||||||
introduced Wipe Code, which introduced some changes to storage that the older firmwares
|
introduced Wipe Code, which introduced some changes to storage that the older firmwares
|
||||||
(e.g. 2.1.8) would not understand. It can also be used to enforce security fixes.
|
(e.g. 2.1.8) would not understand. It can also be used to enforce security fixes.
|
||||||
|
@ -6,7 +6,7 @@ These tests are doing a simple read/write operations on the device to see if the
|
|||||||
|
|
||||||
## Device tests
|
## Device tests
|
||||||
|
|
||||||
Device tests are integration tests that can be run against either emulator or on an actual device.
|
Device tests are integration tests that can be run against either emulator or on an actual device.
|
||||||
You are responsible to provide either an emulator or a device with Debug mode present.
|
You are responsible to provide either an emulator or a device with Debug mode present.
|
||||||
|
|
||||||
### Device tests
|
### Device tests
|
||||||
@ -17,7 +17,7 @@ See [device-tests.md](device-tests.md) for instructions how to run it.
|
|||||||
|
|
||||||
### UI tests
|
### UI tests
|
||||||
|
|
||||||
UI tests use device tests and take screenshots of every screen change and compare them against fixtures. Currently for model T only.
|
UI tests use device tests and take screenshots of every screen change and compare them against fixtures. Currently for model T only.
|
||||||
|
|
||||||
See [ui-tests.md](ui-tests.md) for more info.
|
See [ui-tests.md](ui-tests.md) for more info.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Trezor Legacy
|
# Trezor Legacy
|
||||||
|
|
||||||
Firmware currently running on Model One. If you are working on a new feature, you probably want to contribute this to Core.
|
Firmware currently running on Model One. If you are working on a new feature, you probably want to contribute this to Core.
|
||||||
|
|
||||||
See [`docs/legacy`](../docs/legacy/index.md) for more info.
|
See [`docs/legacy`](../docs/legacy/index.md) for more info.
|
||||||
|
@ -11,7 +11,7 @@ const TokenType tokens[TOKENS_COUNT] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const TokenType _UnknownToken = { 0, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", " UNKN", 0 };
|
static const TokenType _UnknownToken = { 0, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", " UNKN", 0 };
|
||||||
const TokenType *UnknownToken = &_UnknownToken;
|
const TokenType *UnknownToken = &_UnknownToken;
|
||||||
|
|
||||||
const TokenType *tokenByChainAddress(uint32_t chain_id, const uint8_t *address)
|
const TokenType *tokenByChainAddress(uint32_t chain_id, const uint8_t *address)
|
||||||
{
|
{
|
||||||
|
@ -351,4 +351,4 @@ void layoutRequireConfirmMultisig(LiskTransactionAsset *asset) {
|
|||||||
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
|
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
|
||||||
_("Confirm transaction"), keys_group_str, life_time_str,
|
_("Confirm transaction"), keys_group_str, life_time_str,
|
||||||
min_str, NULL, NULL);
|
min_str, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,6 @@ message TxOutputType {
|
|||||||
optional MultisigRedeemScriptType multisig = 5; // multisig output definition
|
optional MultisigRedeemScriptType multisig = 5; // multisig output definition
|
||||||
optional bytes op_return_data = 6; // defines op_return data
|
optional bytes op_return_data = 6; // defines op_return data
|
||||||
optional uint32 decred_script_version = 7; // only for Decred
|
optional uint32 decred_script_version = 7; // only for Decred
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
All outputs must have an `amount` and a `script_type`.
|
All outputs must have an `amount` and a `script_type`.
|
||||||
@ -190,13 +189,13 @@ Otherwise the encoding is identical:
|
|||||||
|
|
||||||
The JSON below encodes a transaction with the following inputs:
|
The JSON below encodes a transaction with the following inputs:
|
||||||
|
|
||||||
* [e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a](https://btc5.trezor.io/tx/e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a)
|
* [e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a](https://btc5.trezor.io/tx/e9cec1644db8fa95fe639a9b503a63ea587d2f4e480d3847703e3ec73adf6b5a)
|
||||||
output **0** (P2PKH address 1Jw5FrKhi2aWbbF4h3QRWLog5AjsJYGswv)
|
output **0** (P2PKH address 1Jw5FrKhi2aWbbF4h3QRWLog5AjsJYGswv)
|
||||||
at derivation path **m/44'/0'/0'/0/282**
|
at derivation path **m/44'/0'/0'/0/282**
|
||||||
amount **85 170** sat
|
amount **85 170** sat
|
||||||
* [1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155](https://btc5.trezor.io/tx/1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155)
|
* [1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155](https://btc5.trezor.io/tx/1f545c0ca1f2c055e199c70457025c1e393edd013a274a976187115a5c601155)
|
||||||
output **0** (P2SH-SegWit address 3DEAk9KGrgvj2gHQ1hyfCXus9hZr9K8Beh)
|
output **0** (P2SH-SegWit address 3DEAk9KGrgvj2gHQ1hyfCXus9hZr9K8Beh)
|
||||||
at derivation path **m/49'/0'/0'/0/55**
|
at derivation path **m/49'/0'/0'/0/55**
|
||||||
amount **500 000** sat
|
amount **500 000** sat
|
||||||
|
|
||||||
And the following outputs:
|
And the following outputs:
|
||||||
|
@ -20,8 +20,8 @@ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
Loading…
Reference in New Issue
Block a user