Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pefontana committed Oct 25, 2023
1 parent b4da689 commit 93d5f0a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Binary file added crates/.DS_Store
Binary file not shown.
8 changes: 5 additions & 3 deletions crates/starknet-types-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Core types representation for Starknet.

The `starknet-types-core` crate provides:
* The universal `Felt` (Field Element) type for Cairo and STARK proofs. It was created to reduce the fragmentation in the Starknet Rust ecosystem by providing a standardized representation of the `Felt` type.
* The `AffinePoint` and `ProjectivePoint` structs, that represent a point in the Stark curve with which you can operate
* The `AffinePoint` and `ProjectivePoint` structs, which represent points on the Stark curve for performing elliptic curve operations.

## Features

Expand All @@ -15,10 +15,12 @@ The `starknet-types-core` crate provides:

## Examples

Here are some examples of how to use the `Felt` type:
Here are some examples of how to use the `starknet-types-core` types:

```rust
let x = Felt::from(18)
let felt = Felt::from(18);
let projective_point = ProjectivePoint::new(Felt::from(0), Felt::from(1), Felt::from(0));
let affine_point = AffinePoint::new(Felt::from(0), Felt::from(1)).unwrap();
```

## Usage
Expand Down
1 change: 0 additions & 1 deletion crates/starknet-types-core/src/curve/projective_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl ProjectivePoint {

/// Creates the same point in affine coordinates. That is,
/// returns [x / z: y / z: 1] where `self` is [x: y: z].
/// Panics if `self` is the point at infinity.
pub fn to_affine(&self) -> Result<AffinePoint, CurveError> {
if self.z() == Felt::ZERO {
return Err(CurveError::EllipticCurveError(InvalidPoint));
Expand Down

0 comments on commit 93d5f0a

Please sign in to comment.