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

36 lines
19 KiB
HTML
Raw Normal View History

<!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 represents an element of a group with basic operations that can be performed. This allows an FFT implementation (for example) to operate generically over either a field or elliptic curve group."><meta name="keywords" content="rust, rustlang, rust-lang, Group"><title>Group 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="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><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="#">Trait Group</a></h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.Scalar">Scalar</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.group_add">group_add</a><a href="#tymethod.group_scale">group_scale</a><a href="#tymethod.group_sub">group_sub</a><a href="#tymethod.group_zero">group_zero</a></div><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><div class="sidebar-links"><a href="#impl-Group-for-Ep">Ep</a><a href="#impl-Group-for-Eq">Eq</a><a href="#impl-Group-for-Fp">Fp</a><a href="#impl-Group-for-Fq">Fq</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../index.html">halo2_proofs</a>::<wbr><a href="index.html">arithmetic</a></h2><div id="sidebar-vars" data-name="Group" 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"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" 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="#">Group</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 Group: 'static + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a>;
fn <a href="#tymethod.group_zero" class="fnname">group_zero</a>() -&gt; Self;
<div class="item-spacer"></div> fn <a href="#tymethod.group_add" class="fnname">group_add</a>(&amp;mut self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self);
<div class="item-spacer"></div> fn <a href="#tymethod.group_sub" class="fnname">group_sub</a>(&amp;mut self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self);
<div class="item-spacer"></div> fn <a href="#tymethod.group_scale" class="fnname">group_scale</a>(&amp;mut self, by: &amp;Self::<a class="associatedtype" href="trait.Group.html#associatedtype.Scalar" title="type halo2_proofs::arithmetic::Group::Scalar">Scalar</a>);
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This represents an element of a group with basic operations that can be
performed. This allows an FFT implementation (for example) to operate
generically over either a field or elliptic curve group.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Scalar" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a>: <a class="trait" href="trait.FieldExt.html" title="trait halo2_proofs::arithmetic::FieldExt">FieldExt</a></h4></div></summary><div class="docblock"><p>The group is assumed to be of prime order $p$. <code>Scalar</code> is the
associated scalar field of size $p$.</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.group_zero" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.group_zero" class="fnname">group_zero</a>() -&gt; Self</h4></div></summary><div class="docblock"><p>Returns the additive identity of the group.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.group_add" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.group_add" class="fnname">group_add</a>(&amp;mut self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class="docblock"><p>Adds <code>rhs</code> to this group element.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.group_sub" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.group_sub" class="fnname">group_sub</a>(&amp;mut self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class="docblock"><p>Subtracts <code>rhs</code> from this group element.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.group_scale" class="method has-srclink"><div class="rightside"></div><h4 class="code-header">fn <a href="#tymethod.group_scale" class="fnname">group_scale</a>(&amp;mut self, by: &amp;Self::<a class="associatedtype" href="trait.Group.html#associatedtype.Scalar" title="type halo2_proofs::arithmetic::Group::Scalar">Scalar</a>)</h4></div></summary><div class="docblock"><p>Scales this group element by a scalar.</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><div id="impl-Group-for-Fp" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Group-for-Fp" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.Group.html" title="trait halo2_proofs::arithmetic::Group">Group</a> for Fp</h3></div></summary><div class="impl-items"><div id="associatedtype.Scalar-1" class="type trait-impl has-srclink"><a href="#associatedtype.Scalar-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = Fp</h4></div><div id="method.group_zero" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_zero" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_zero" class="fnname">group_zero</a>() -&gt; Fp</h4></div><div id="method.group_add" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_add" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_add" class="fnname">group_add</a>(&amp;mut self, rhs: &amp;Fp)</h4></div><div id="method.group_sub" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_sub" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_sub" class="fnname">group_sub</a>(&amp;mut self, rhs: &amp;Fp)</h4></div><div id="method.group_scale" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_scale" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_scale" class="fnname">group_scale</a>(&amp;mut self, by: &amp;&lt;Fp as <a class="trait" href="trait.Group.html" title="trait halo2_proofs::arithmetic::Group">Group</a>&gt;::<a class="associatedtype" href="trait.Group.html#associatedtype.Scalar" title="type halo2_proofs::arithmetic::Group::Scalar">Scalar</a>)</h4></div></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Group-for-Eq" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Group-for-Eq" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.Group.html" title="trait halo2_proofs::arithmetic::Group">Group</a> for Eq</h3></div></summary><div class="impl-items"><div id="associatedtype.Scalar-2" class="type trait-impl has-srclink"><a href="#associatedtype.Scalar-2" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = Fp</h4></div><div id="method.group_zero-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_zero-1" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_zero" class="fnname">group_zero</a>() -&gt; Eq</h4></div><div id="method.group_add-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_add-1" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_add" class="fnname">group_add</a>(&amp;mut self, rhs: &amp;Eq)</h4></div><div id="method.group_sub-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_sub-1" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_sub" class="fnname">group_sub</a>(&amp;mut self, rhs: &amp;Eq)</h4></div><div id="method.group_scale-1" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.group_scale-1" class="anchor"></a><h4 class="code-header">pub fn <a href="#tymethod.group_scale" class="fnname">group_scale</a>(&amp;mut self, by: &amp;&lt;Eq as <a class="trait" href="trait.Group.html" title="trait halo2_proofs::arithmetic::Group">Group</a>&gt;::<a class="associatedtype" href="trait.Group.html#associatedtype.Scalar" title="type halo2_proofs::arithmetic::Group::Scalar">Scalar</a>)</h4></div></div></details><details class="rustdoc-toggle imp
</body></html>