Skip to content

Commit

Permalink
object: specify hash types, fix #276
Browse files Browse the repository at this point in the history
While technically we could use Streebog or something here, practically it'd be
incompatible with current networks, so specific hash types are important.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Dec 26, 2024
1 parent 20842ff commit a55e10e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ message ShortHeader {
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
uint64 payload_length = 5 [json_name = "payloadLength"];

// Hash of payload bytes
// SHA256 hash of payload bytes.
neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"];

// Homomorphic hash of the object payload
// Homomorphic hash of the object payload (Tillich-Zemor).
neo.fs.v2.refs.Checksum homomorphic_hash = 7 [json_name = "homomorphicHash"];
}

Expand All @@ -180,13 +180,13 @@ message Header {
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown.
uint64 payload_length = 5 [json_name = "payloadLength"];

// Hash of payload bytes
// SHA256 hash of payload bytes
neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"];

// Type of the object payload content
ObjectType object_type = 7 [json_name = "objectType"];

// Homomorphic hash of the object payload
// Homomorphic hash of the object payload (Tillich-Zemor).
neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"];

// Session token, if it was used during Object creation. Need it to verify
Expand Down
8 changes: 4 additions & 4 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,9 @@ Object Header
| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner |
| creation_epoch | [uint64](#uint64) | | Object creation Epoch |
| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. |
| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes |
| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | SHA256 hash of payload bytes |
| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content |
| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload |
| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload (Tillich-Zemor). |
| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. |
| attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes. Attributes vary in length from object to object, so keep an eye on the entire Header limit depending on the context. |
| split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy |
Expand Down Expand Up @@ -1088,8 +1088,8 @@ Short header fields
| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner |
| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content |
| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown |
| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes |
| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload |
| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | SHA256 hash of payload bytes. |
| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload (Tillich-Zemor). |


<a name="neo.fs.v2.object.SplitInfo"></a>
Expand Down

0 comments on commit a55e10e

Please sign in to comment.