halo2/rustdoc/latest/halo2_proofs/arithmetic/trait.CurveExt.html

72 lines
39 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This trait is a common interface for dealing with elements of an elliptic curve group in a “projective” form, where that arithmetic is usually more efficient."><meta name="keywords" content="rust, rustlang, rust-lang, CurveExt"><title>CurveExt in halo2_proofs::arithmetic - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
</script>
</head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../halo2_proofs/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"></h2>
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../halo2_proofs/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">CurveExt</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-associated-types">Required Associated Types</a></h3><ul><li><a href="#associatedtype.AffineExt">AffineExt</a></li><li><a href="#associatedtype.Base">Base</a></li><li><a href="#associatedtype.ScalarExt">ScalarExt</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-associated-consts">Required Associated Constants</a></h3><ul><li><a href="#associatedconstant.CURVE_ID">CURVE_ID</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.a">a</a></li><li><a href="#tymethod.b">b</a></li><li><a href="#tymethod.endo">endo</a></li><li><a href="#tymethod.hash_to_curve">hash_to_curve</a></li><li><a href="#tymethod.is_on_curve">is_on_curve</a></li><li><a href="#tymethod.jacobian_coordinates">jacobian_coordinates</a></li><li><a href="#tymethod.new_jacobian">new_jacobian</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-CurveExt-for-Ep">Ep</a></li><li><a href="#impl-CurveExt-for-Eq">Eq</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In halo2_proofs::arithmetic</a></h2><div id="sidebar-vars" data-name="CurveExt" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../halo2_proofs/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">halo2_proofs</a>::<wbr><a href="index.html">arithmetic</a>::<wbr><a class="trait" href="#">CurveExt</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait CurveExt: PrimeCurve&lt;Affine = Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a>, Scalar = Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt; + Group + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://docs.rs/subtle/2.4.1/subtle/trait.ConditionallySelectable.html" title="trait subtle::ConditionallySelectable">ConditionallySelectable</a> + <a class="trait" href="https://docs.rs/subtle/2.4.1/subtle/trait.ConstantTimeEq.html" title="trait subtle::ConstantTimeEq">ConstantTimeEq</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::Affine&gt; + <a class="trait" href="trait.Group.html" title="trait halo2_proofs::arithmetic::Group">Group</a>&lt;Scalar = Self::Scalar&gt; {
type <a href="#associatedtype.ScalarExt" class="associatedtype">ScalarExt</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a>;
type <a href="#associatedtype.Base" class="associatedtype">Base</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a>;
type <a href="#associatedtype.AffineExt" class="associatedtype">AffineExt</a>: <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a>&gt;::<a class="associatedtype" href="trait.CurveAffine.html#associatedtype.CurveExt" title="type halo2_proofs::arithmetic::CurveAffine::CurveExt">CurveExt</a> == Self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a>&gt;::<a class="associatedtype" href="trait.CurveAffine.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveAffine::ScalarExt">ScalarExt</a> == Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#associatedtype.Output" title="type core::ops::arith::Mul::Output">Output</a> == Self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#associatedtype.Output" title="type core::ops::arith::Mul::Output">Output</a> == Self</span>;
const <a href="#associatedconstant.CURVE_ID" class="constant">CURVE_ID</a>: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
fn <a href="#tymethod.endo" class="fnname">endo</a>(&amp;self) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.jacobian_coordinates" class="fnname">jacobian_coordinates</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.hash_to_curve" class="fnname">hash_to_curve</a>(domain_prefix: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) + 'a, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.is_on_curve" class="fnname">is_on_curve</a>(&amp;self) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.Choice.html" title="struct subtle::Choice">Choice</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.a" class="fnname">a</a>() -&gt; Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.b" class="fnname">b</a>() -&gt; Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.new_jacobian" class="fnname">new_jacobian</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.CtOption.html" title="struct subtle::CtOption">CtOption</a>&lt;Self&gt;;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This trait is a common interface for dealing with elements of an elliptic
curve group in a “projective” form, where that arithmetic is usually more
efficient.</p>
<p>Requires the <code>alloc</code> feature flag because of <code>hash_to_curve</code>.</p>
</div></details><h2 id="required-associated-types" class="small-section-header">Required Associated Types<a href="#required-associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.ScalarExt" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">type <a href="#associatedtype.ScalarExt" class="associatedtype">ScalarExt</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a></h4></div></summary><div class="docblock"><p>The scalar field of this elliptic curve.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Base" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">type <a href="#associatedtype.Base" class="associatedtype">Base</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a></h4></div></summary><div class="docblock"><p>The base field over which this elliptic curve is constructed.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.AffineExt" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">type <a href="#associatedtype.AffineExt" class="associatedtype">AffineExt</a>: <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt; <br><span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a>&gt;::<a class="associatedtype" href="trait.CurveAffine.html#associatedtype.CurveExt" title="type halo2_proofs::arithmetic::CurveAffine::CurveExt">CurveExt</a> == Self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="trait.CurveAffine.html" title="trait halo2_proofs::arithmetic::CurveAffine">CurveAffine</a>&gt;::<a class="associatedtype" href="trait.CurveAffine.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveAffine::ScalarExt">ScalarExt</a> == Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#associatedtype.Output" title="type core::ops::arith::Mul::Output">Output</a> == Self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.AffineExt" title="type halo2_proofs::arithmetic::CurveExt::AffineExt">AffineExt</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.ScalarExt" title="type halo2_proofs::arithmetic::CurveExt::ScalarExt">ScalarExt</a>&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#associatedtype.Output" title="type core::ops::arith::Mul::Output">Output</a> == Self</span></h4></div></summary><div class="docblock"><p>The affine version of the curve</p>
</div></details></div><h2 id="required-associated-consts" class="small-section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.CURVE_ID" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">const <a href="#associatedconstant.CURVE_ID" class="constant">CURVE_ID</a>: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></div></summary><div class="docblock"><p>CURVE_ID used for hash-to-curve.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.endo" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.endo" class="fnname">endo</a>(&amp;self) -&gt; Self</h4></div></summary><div class="docblock"><p>Apply the curve endomorphism by multiplying the x-coordinate
by an element of multiplicative order 3.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.jacobian_coordinates" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.jacobian_coordinates" class="fnname">jacobian_coordinates</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></h4></div></summary><div class="docblock"><p>Return the Jacobian coordinates of this point.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.hash_to_curve" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.hash_to_curve" class="fnname">hash_to_curve</a>(domain_prefix: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) + 'a, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;</h4></div></summary><div class="docblock"><p>Requests a hasher that accepts messages and returns near-uniformly
distributed elements in the group, given domain prefix <code>domain_prefix</code>.</p>
<p>This method is suitable for use as a random oracle.</p>
<h5 id="example"><a href="#example">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">pasta_curves::arithmetic::CurveExt</span>;
<span class="kw">fn</span> <span class="ident">pedersen_commitment</span><span class="op">&lt;</span><span class="ident">C</span>: <span class="ident">CurveExt</span><span class="op">&gt;</span>(
<span class="ident">x</span>: <span class="ident">C::ScalarExt</span>,
<span class="ident">r</span>: <span class="ident">C::ScalarExt</span>,
) -&gt; <span class="ident">C::Affine</span> {
<span class="kw">let</span> <span class="ident">hasher</span> <span class="op">=</span> <span class="ident">C::hash_to_curve</span>(<span class="string">&quot;z.cash:example_pedersen_commitment&quot;</span>);
<span class="kw">let</span> <span class="ident">g</span> <span class="op">=</span> <span class="ident">hasher</span>(<span class="string">b&quot;g&quot;</span>);
<span class="kw">let</span> <span class="ident">h</span> <span class="op">=</span> <span class="ident">hasher</span>(<span class="string">b&quot;h&quot;</span>);
(<span class="ident">g</span> <span class="op">*</span> <span class="ident">x</span> <span class="op">+</span> <span class="kw-2">&amp;</span>(<span class="ident">h</span> <span class="op">*</span> <span class="ident">r</span>)).<span class="ident">to_affine</span>()
}</code></pre></div>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.is_on_curve" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.is_on_curve" class="fnname">is_on_curve</a>(&amp;self) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.Choice.html" title="struct subtle::Choice">Choice</a></h4></div></summary><div class="docblock"><p>Returns whether or not this element is on the curve; should
always be true unless an “unchecked” API was used.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.a" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.a" class="fnname">a</a>() -&gt; Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></div></summary><div class="docblock"><p>Returns the curve constant a.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.b" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.b" class="fnname">b</a>() -&gt; Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></div></summary><div class="docblock"><p>Returns the curve constant b.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.new_jacobian" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.new_jacobian" class="fnname">new_jacobian</a>(x: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, y: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, z: Self::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.CtOption.html" title="struct subtle::CtOption">CtOption</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Obtains a point given Jacobian coordinates $X : Y : Z$, failing
if the coordinates are not on the curve.</p>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-CurveExt-for-Eq" class="impl has-srclink"><a href="#impl-CurveExt-for-Eq" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a> for Eq</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.endo" class="method trait-impl has-srclink"><a href="#method.endo" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.endo" class="fnname">endo</a>(&amp;self) -&gt; Eq</h4></section></summary><div class="docblock"><p>Apply the curve endomorphism by multiplying the x-coordinate
by an element of multiplicative order 3.</p>
</div></details><section id="associatedtype.ScalarExt-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.ScalarExt-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.ScalarExt" class="associatedtype">ScalarExt</a> = Fp</h4></section><section id="associatedtype.Base-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Base-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Base" class="associatedtype">Base</a> = Fq</h4></section><section id="associatedtype.AffineExt-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.AffineExt-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.AffineExt" class="associatedtype">AffineExt</a> = EqAffine</h4></section><section id="associatedconstant.CURVE_ID-1" class="associatedconstant trait-impl has-srclink"><a href="#associatedconstant.CURVE_ID-1" class="anchor"></a><h4 class="code-header">const <a href="#associatedconstant.CURVE_ID" class="constant">CURVE_ID</a>: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "vesta"</h4></section><section id="method.hash_to_curve" class="method trait-impl has-srclink"><a href="#method.hash_to_curve" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.hash_to_curve" class="fnname">hash_to_curve</a>(domain_prefix: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) + 'a, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;</h4></section><section id="method.a" class="method trait-impl has-srclink"><a href="#method.a" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.a" class="fnname">a</a>() -&gt; &lt;Eq as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></section><section id="method.b" class="method trait-impl has-srclink"><a href="#method.b" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.b" class="fnname">b</a>() -&gt; &lt;Eq as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></section><section id="method.new_jacobian" class="method trait-impl has-srclink"><a href="#method.new_jacobian" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.new_jacobian" class="fnname">new_jacobian</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;x: &lt;Eq as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;y: &lt;Eq as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;z: &lt;Eq as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a><br>) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.CtOption.html" title="struct subtle::CtOption">CtOption</a>&lt;Eq&gt;</h4></section><section id="method.jacobian_coordinates" class="method trait-impl has-srclink"><a href="#method.jacobian_coordinates" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.jacobian_coordinates" class="fnname">jacobian_coordinates</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Fq, Fq, Fq<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></h4></section><section id="method.is_on_curve" class="method trait-impl has-srclink"><a href="#method.is_on_curve" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.is_on_curve" class="fnname">is_on_curve</a>(&amp;self) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.Choice.html" title="struct subtle::Choice">Choice</a></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-CurveExt-for-Ep" class="impl has-srclink"><a href="#impl-CurveExt-for-Ep" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a> for Ep</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.endo-1" class="method trait-impl has-srclink"><a href="#method.endo-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.endo" class="fnname">endo</a>(&amp;self) -&gt; Ep</h4></section></summary><div class="docblock"><p>Apply the curve endomorphism by multiplying the x-coordinate
by an element of multiplicative order 3.</p>
</div></details><section id="associatedtype.ScalarExt-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.ScalarExt-2" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.ScalarExt" class="associatedtype">ScalarExt</a> = Fq</h4></section><section id="associatedtype.Base-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Base-2" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Base" class="associatedtype">Base</a> = Fp</h4></section><section id="associatedtype.AffineExt-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.AffineExt-2" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.AffineExt" class="associatedtype">AffineExt</a> = EpAffine</h4></section><section id="associatedconstant.CURVE_ID-2" class="associatedconstant trait-impl has-srclink"><a href="#associatedconstant.CURVE_ID-2" class="anchor"></a><h4 class="code-header">const <a href="#associatedconstant.CURVE_ID" class="constant">CURVE_ID</a>: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "pallas"</h4></section><section id="method.hash_to_curve-1" class="method trait-impl has-srclink"><a href="#method.hash_to_curve-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.hash_to_curve" class="fnname">hash_to_curve</a>(domain_prefix: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) + 'a, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>&gt;</h4></section><section id="method.a-1" class="method trait-impl has-srclink"><a href="#method.a-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.a" class="fnname">a</a>() -&gt; &lt;Ep as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></section><section id="method.b-1" class="method trait-impl has-srclink"><a href="#method.b-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.b" class="fnname">b</a>() -&gt; &lt;Ep as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a></h4></section><section id="method.new_jacobian-1" class="method trait-impl has-srclink"><a href="#method.new_jacobian-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.new_jacobian" class="fnname">new_jacobian</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;x: &lt;Ep as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;y: &lt;Ep as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;z: &lt;Ep as <a class="trait" href="trait.CurveExt.html" title="trait halo2_proofs::arithmetic::CurveExt">CurveExt</a>&gt;::<a class="associatedtype" href="trait.CurveExt.html#associatedtype.Base" title="type halo2_proofs::arithmetic::CurveExt::Base">Base</a><br>) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.CtOption.html" title="struct subtle::CtOption">CtOption</a>&lt;Ep&gt;</h4></section><section id="method.jacobian_coordinates-1" class="method trait-impl has-srclink"><a href="#method.jacobian_coordinates-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.jacobian_coordinates" class="fnname">jacobian_coordinates</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Fp, Fp, Fp<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></h4></section><section id="method.is_on_curve-1" class="method trait-impl has-srclink"><a href="#method.is_on_curve-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.is_on_curve" class="fnname">is_on_curve</a>(&amp;self) -&gt; <a class="struct" href="https://docs.rs/subtle/2.4.1/subtle/struct.Choice.html" title="struct subtle::Choice">Choice</a></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/pasta_curves/arithmetic/curves/trait.CurveExt.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="halo2_proofs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (30f386087 2022-05-05)" ></div>
</body></html>