Coder Social home page Coder Social logo

ecdh-noir's Introduction

noir ecdh

Curve Params

secp256k1

p=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F a=0000000000000000000000000000000000000000000000000000000000000000 b=0000000000000000000000000000000000000000000000000000000000000007 Gx=79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 Gy=483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8 n=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141

secp256r1 (p256)

p=FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF a=FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC b=5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B Gx=6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296 Gy=4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5 n=FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551

arithmetic

r = p + q

$$

    \begin{gathered}
    \lambda_{1}=\mathbf x_{1}\mathrm z_{2}^{2} \\
    \lambda_2=\operatorname{x}_2\operatorname{z}_1^{\overline{2}} \\
    \lambda_{3}=\lambda_{1}-\lambda_{2} \\
    \lambda_4=\mathbf{y}_1\mathbf{z}_2^3 \\
    \lambda_5=\mathbf{y}_2\mathbf{z}_1^3 \\
    \lambda_{6}=\lambda_{4}-\lambda_{5} \\
    \lambda_{7}=\lambda_{1}+\lambda_{2} \\
    \lambda_8=\lambda_4+\lambda_5 \\
    \mathrm{x}_3=\lambda_6^2-\lambda_7\lambda_3^2 \\
    \lambda_{9}=\lambda_{7}\lambda_{3}^{2}-2\mathrm{x}_{3} \\
    \mathbf{y}_{3}=(\lambda_{9}\lambda_{6}-\lambda_{8}\lambda_{3}^{3})/2 \\
    \mathrm{z}_3=\mathrm{z}_1\mathrm{z}_2\lambda_3
    \end{gathered}

$$

r = p * 2

$$ \begin{gathered} \lambda_1=3\text{x}1^2+\text{az}1^4 \ \lambda{2}=4\mathrm{x}{1}\mathrm{y}{1}^{2} \ \lambda_3=8\mathrm{y}1^4 \ \mathrm{x}3=\lambda_1^2-2\lambda_2 \ \mathbf{y}{3}=\lambda{1}(\lambda{2}-\mathbf{x}{3})-\lambda{3} \ \mathrm{z}_3=2\mathrm{y}_1\mathrm{z}_1 \end{gathered} $$

ECDH

$$ \begin{gathered} secret = pk_1 * sk_2 = pk_2 * sk_1 \

pk_1 = sk_1 * G \ pk_2 = sk_2 * G \

\to sk_1 * G * sk_2 = sk_2 * G * sk_1 \ \to pk_1 * sk_2 = pk_2 * sk_1 \end{gathered} $$

Tools

Calculator

params calculator using sympy

ref

ecdh-noir's People

Contributors

code-pangolin avatar kaola526 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.