Update TODO in CurveScalar.from_digest()

pull/267/head
Bogdan Opanchuk 2021-05-18 14:17:50 -07:00
parent 54b9ee088b
commit cae54575e5
1 changed files with 4 additions and 4 deletions

View File

@ -37,12 +37,12 @@ class CurveScalar(Serializable):
@classmethod
def from_digest(cls, digest: 'Hash') -> 'CurveScalar':
# TODO (#39): to be replaced by the standard algroithm.
# Currently just matching what we have in RustCrypto stack
# TODO (#39): this is used in Umbral scheme itself,
# and needs to be able to return a guaranteed nonzero scalar.
# Currently just matching what we have in rust-umbral
# (taking bytes modulo curve order).
# Can produce zeros!
bn = openssl.bn_from_bytes(digest.finalize(), apply_modulus=CURVE.bn_order)
return cls(bn)
return cls(openssl.bn_from_bytes(digest.finalize(), apply_modulus=CURVE.bn_order))
@classmethod
def __take__(cls, data: bytes) -> Tuple['CurveScalar', bytes]: