Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions Signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ where a `signature` is encoded as:
| ------------- | ----------- | ---------------------------------------------------------- |
| key_id_len | `varuint32` | Public key identifier length in bytes (can be `0`) |
| key_id | `bytes` | Public key identifier |
| signature_id | `byte` | Signature algorithm identifier |
| signature_len | `varuint32` | Signature length in bytes |
| signature | `bytes` | Signature for `hashes` that can be verified using `key_id` |

Expand Down Expand Up @@ -181,6 +182,8 @@ Public and private keys must include the algorithm and parameters they were crea
| Ed25519 public key | 1 + 32 bytes | `0x01` |
| Ed25519 key pair | 1 + 64 bytes | `0x81` |

Ed25519 algorithm identifier: `0x01`.

Representation of Ed25519 keys:

- Ed25519 public key:
Expand Down Expand Up @@ -258,8 +261,9 @@ Content of the signature section, for a single signature:
- `1` (`signatures_count`)
- signature:
- `0` (`key_id_len` - no key ID)
- `65` (`signature_len`)
- `<65 bytes>` (0x01 ‖ Ed22519(k, hashes))
- `0x01` (Ed25519 algorithm identifier)
- `64` (`signature_len`)
- `<64 bytes>` (Ed22519(k, hashes))

### Signatures allowing partial verification.

Expand Down Expand Up @@ -306,8 +310,9 @@ Content of the signature section, for a single signature:
- `1` (signatures_count)
- signature:
- `0` (key_id_len - no key ID)
- `65` (signature_len)
- `<65 bytes>` (0x01 ‖ Ed22519(k, hashes))
- `0x01` (Ed25519 algorithm identifier)
- `64` (signature_len)
- `<64 bytes>` (Ed22519(k, hashes))

Variant with two signatures for the same content and key identifiers:

Expand All @@ -321,10 +326,12 @@ Variant with two signatures for the same content and key identifiers:
- signature_1:
- `5` (key_id_len)
- `"first"` (key_id)
- `65` (`signature_len`)
- `<65 bytes>` (0x01 ‖ Ed22519(k_first, hashes))
- `0x01` (Ed25519 algorithm identifier)
- `64` (`signature_len`)
- `<64 bytes>` (Ed22519(k_first, hashes))
- signature_2:
- `6` (key_id_len)
- `"second"` (key_id)
- `65` (`signature_len`)
- `<65 bytes>` (0x01 ‖ Ed22519(k_second, hashes))
- `0x01` (Ed25519 identifier)
- `64` (`signature_len`)
- `<64 bytes>` (Ed22519(k_second, hashes))