Skip to content

Some observations / possible optimisation #7

@caronni

Description

@caronni

Thank you for this nice implementation of SSS!

I'd like to bring a few issues to your attention:

  1. Your choice of prime excludes 189 secret values in the range (0..2^256-1). Now, chances are tiny that any slice of s is >= your prime, but how about checking, or slicing by p, instead of 2^256, just in case?

  2. What if my random secret just happens to have trailing zeros? Would those not be lost in mergeIntToByte()? I guess that warrants at least a documentation, or maybe encoding the length of the secret in some form.

  3. Thank you for not reusing the polynomial coefficients a_1 .. a_{k-1} across the different pieces of large secrets. That would have ruined the day :-)

  4. Suggestion: In the literature, people use x=1..n without adverse effects. This would almost halve the size of your output.

Putting these points up for discussion here. Do you think they are valid, and might warrant a code change?

Germano

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