Skip to content

Access and serizalize inner state for Digest #1579

Closed as not planned
Closed as not planned
@ikrivosheev

Description

@ikrivosheev

Hello! Thank you for the great library. I'll to describe what my issue.

Pipeline of work with file is:

  1. Create file with state
  2. Upload chunk of bytes <-- it can call multiple time.
  3. Finalize

State's shared between different process and different requests. I need to store hash inner state into database and then restore it in another process.

I can use this API: decompose. But don't have API to get Sha256VarCore from CtVariableCoreWrapper and Sha256VarCore cannot serialize into bytes.

Simple code:

let mut sha = Sha256::new();
sha2.update(bytes);
let (core, buffer) = sha.decompose();
// Store core and buffer into database

In other process after some time:

// load core and buffer from database
let mut sha = Sha256::from_core(core);
sha.update(buffer.get_data());
sha.update(data);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions