1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

crypto, math: change option to result (#17580)

This commit is contained in:
yuyi 2023-03-10 16:31:05 +08:00 committed by GitHub
parent 32d09544d7
commit b42a3f43a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ fn (mut s Scalar) pow2k(k int) {
// If the coordinates are invalid or don't represent a valid point on the curve,
// set_extended_coordinates returns an error and the receiver is
// unchanged. Otherwise, set_extended_coordinates returns v.
fn (mut v Point) set_extended_coordinates(x Element, y Element, z Element, t Element) ?Point {
fn (mut v Point) set_extended_coordinates(x Element, y Element, z Element, t Element) !Point {
if !is_on_curve(x, y, z, t) {
return error('edwards25519: invalid point coordinates')
}

View File

@ -417,7 +417,7 @@ pub fn uint128_new(lo u64, hi u64) Uint128 {
return Uint128{lo, hi}
}
pub fn uint128_from_dec_str(value string) ?Uint128 {
pub fn uint128_from_dec_str(value string) !Uint128 {
mut res := unsigned.uint128_zero
for b_ in value.bytes() {
b := b_ - '0'.bytes()[0]