Skip to content

Commit

Permalink
secpr1 minor fixes (#1522)
Browse files Browse the repository at this point in the history
* init

* cont

* cont

* cont

* minor fix

* minor fix

* minor fix

* minor fix
  • Loading branch information
LandauRaz authored Feb 14, 2025
1 parent 2669156 commit a93b1ba
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,16 @@ data.append(2_u256);
let hash = keccak_u256s_le_inputs(data.span());
----

== secp256r1
== `secp256r1`

The secp256r1 curve (also known as NIST P-256) is commonly used in traditional PKI and secure communications.
Various systems calls for computations over the secp256r1 curve (also known as NIST P-256).

These system calls are particularly useful when implementing traditional PKI or secure communication functionality, as secp256r1 is widely used in TLS, secure messaging, and government standards.

[IMPORTANT]
Note that instead of using these syscalls directly, it is recommended to use the traits and implementations provided in the https://docs.swmansion.com/scarb/corelib/core-starknet-secp256r1.html[`secp256_module`^] which provide a more convenient interface and handle the syscalls under the hood.
Instead of using these syscalls directly, it is recommended to use the traits and implementations of the https://docs.swmansion.com/scarb/corelib/core-starknet-secp256r1.html[corelib's `secp256r1` module^] which provides a more convenient interface and handles them for you.

`secp256r1_new_syscall`
=== `secp256r1_new`

==== Function signature

Expand All @@ -544,7 +546,7 @@ extern fn secp256r1_new_syscall(

==== Description

Creates a new point on the secp256r1 curve (also known as NIST P-256) from its x and y coordinates.
Creates a new point on the secp256r1 curve from its x and y coordinates.

==== Arguments

Expand Down Expand Up @@ -586,7 +588,7 @@ match point {
}
----

`secp256r1_add_syscall`
=== `secp256r1_add`

==== Function signature

Expand Down Expand Up @@ -639,7 +641,7 @@ let sum = secp256r1_add_syscall(point1, point2).unwrap_syscall();
let (sum_x, sum_y) = secp256r1_get_xy_syscall(sum).unwrap_syscall();
----

`secp256r1_mul_syscall`
=== `secp256r1_mul`

==== Function signature

Expand Down Expand Up @@ -689,7 +691,7 @@ let product = secp256r1_mul_syscall(point, scalar).unwrap_syscall();
let (product_x, product_y) = secp256r1_get_xy_syscall(product).unwrap_syscall();
----

`secp256r1_get_point_from_x_syscall`
=== `secp256r1_get_point_from_x`

==== Function signature

Expand Down Expand Up @@ -745,7 +747,7 @@ match point {
}
----

`secp256r1_get_xy_syscall`
=== `secp256r1_get_xy`

==== Function signature

Expand Down

0 comments on commit a93b1ba

Please sign in to comment.