Skip to content

add binary exponent return #36

@AVI-crak

Description

@AVI-crak

int bignum_r_degree(struct bn* n)
{
int i = BN_ARRAY_SIZE;
while ((n->array[--i] == 0) && i);
int out = i * WORD_SIZE * 8;
out += 32 - __builtin_clz(n->array[i]);
return out;
}
Returns the number of bits used to write the number (!!!not the buffer size).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions