Skip to content

Wrong message in deprecation warning #346

Closed
@nmoreaud

Description

@nmoreaud

util.string_to_number seems different from int_to_string

def int_to_string(x):  # pragma: no cover
    """Convert integer x into a string of bytes, as per X9.62."""
    # deprecated in 0.19
    warnings.warn(
        "Function is unused in library code. If you use this code, "
        "change to util.string_to_number.",
        DeprecationWarning,
    )
    assert x >= 0
    if x == 0:
        return b"\0"
    result = []
    while x:
        ordinal = x & 0xFF
        result.append(int2byte(ordinal))
        x >>= 8

    result.reverse()
    return b"".join(result)

Metadata

Metadata

Assignees

Labels

bugunintended behaviour in ecdsa code

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions