Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gadgets to API surface, UInt32, UInt64, implement rot32 #1259

Merged
merged 62 commits into from
Dec 19, 2023

Commits on Nov 14, 2023

  1. feat(int.ts): add support for bitwise XOR, NOT, rotate, leftShift, ri…

    …ghtShift, and bitwise AND operations on UInt64 values using Gadgets module
    
    The Gadgets module provides implementations for bitwise XOR, NOT, rotate, leftShift, rightShift, and bitwise AND operations on UInt64 values. These operations are useful for performing bitwise operations on UInt64 values in a circuit.
    
    The following operations have been added:
    
    - `xor(x: UInt64)`: Performs a bitwise XOR operation between the current UInt64 value and the provided UInt64 value `x`. Returns a new UInt64 value representing the result of the XOR operation.
    
    - `not(checked = true)`: Performs a bitwise NOT operation on the current UInt64 value. If the `checked` parameter is set to `true`, the operation is implemented using the `Gadgets.xor` gadget with a second argument as an all one bitmask of the same length. If the `checked` parameter is set to `false`, the operation is implemented as a subtraction of the input from the all one bitmask. Returns a new UInt64 value representing the result of the NOT operation.
    
    - `rotate(direction: 'left' | 'right' = 'left')`: Performs a bitwise rotation operation on the current UInt64 value. The `direction` parameter determines the direction of the rotation, with `'left'` indicating a left rotation and `'right'` indicating a right rotation. Returns a new UInt64 value representing the result of the rotation operation.
    
    - `leftShift()`: Performs a bitwise left shift operation on the current UInt64 value. Returns a new UInt64 value representing the result of the left shift operation.
    
    - `rightShift()`: Performs a bitwise right shift operation on the current UInt64 value. Returns a new UInt64 value representing the result of the right shift operation.
    
    - `and(x: UInt64)`: Performs a bitwise AND operation between the current UInt64 value and the provided UInt64 value `x`. Returns a new UInt64 value representing the result of the AND operation.
    
    These operations provide additional functionality for working with UInt64 values in circuits.
    Trivo25 committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    fb543ed View commit details
    Browse the repository at this point in the history
  2. fix(int.ts): update parameter name in rotate method from 'direction' …

    …to 'bits' to improve clarity
    
    feat(int.ts): add documentation for the rotate, leftShift, rightShift, and and methods to improve code understanding and usage
    Trivo25 committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    840fc7a View commit details
    Browse the repository at this point in the history
  3. fix(int.ts): fix instantiation of UInt64 in example code by using the…

    … 'from' method instead of direct instantiation to improve clarity and consistency
    
    feat(int.ts): add support for bitwise XOR operation on UInt32 elements to perform XOR operation between two UInt32 elements
    feat(int.ts): add support for bitwise NOT operation on UInt32 elements to perform bitwise negation of a UInt32 element
    feat(int.ts): add support for rotation operation on UInt32 elements to perform left and right rotation of bits in a UInt32 element
    feat(int.ts): add support for left shift operation on UInt32 elements to perform left shift of bits in a UInt32 element
    feat(int.ts): add support for right shift operation on UInt32 elements to perform right shift of bits in a UInt32 element
    feat(int.ts): add support for bitwise AND operation on UInt32 elements to perform AND operation between two UInt32 elements
    Trivo25 committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    f6f9177 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    5020ce3 View commit details
    Browse the repository at this point in the history
  2. same for uint32

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    63fa85f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    14f2051 View commit details
    Browse the repository at this point in the history
  4. bump bindings

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    3932338 View commit details
    Browse the repository at this point in the history
  5. add divMod32, addMod32

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    8c524b6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7d8ff8e View commit details
    Browse the repository at this point in the history
  7. add rotate32 tests

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    27d6f8a View commit details
    Browse the repository at this point in the history
  8. epose rot32

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    0d5e09b View commit details
    Browse the repository at this point in the history
  9. rangeCheck32

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    81c90c4 View commit details
    Browse the repository at this point in the history
  10. add rotate32 to UInt32

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    aafd4b8 View commit details
    Browse the repository at this point in the history
  11. fix tests

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    6419176 View commit details
    Browse the repository at this point in the history
  12. fix vk regression test

    Trivo25 committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    e8cac1a View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. add constant check

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    4685946 View commit details
    Browse the repository at this point in the history
  2. re-add range checks

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    4013f14 View commit details
    Browse the repository at this point in the history
  3. add doc comments

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    bc9a20e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    14a7717 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    51d0bfd View commit details
    Browse the repository at this point in the history
  6. Undo comment

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    ce34be8 View commit details
    Browse the repository at this point in the history
  7. bump bindings

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    4d78fc0 View commit details
    Browse the repository at this point in the history
  8. fix return type opf witness

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    d370e29 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    08069bb View commit details
    Browse the repository at this point in the history
  10. adjust error message

    Trivo25 committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    954607e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0878630 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e25d896 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2023

  1. simplify tests

    Trivo25 committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    62c1635 View commit details
    Browse the repository at this point in the history
  2. refactor rangeCheckHelper

    Trivo25 committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    93be2b0 View commit details
    Browse the repository at this point in the history
  3. fix import

    Trivo25 committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    12f388d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    982d3b0 View commit details
    Browse the repository at this point in the history
  5. changelog

    Trivo25 committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    2b091e4 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. Update src/lib/gadgets/gadgets.ts

    Co-authored-by: Gregor Mitscha-Baude <gregor.mitscha-baude@gmx.at>
    Trivo25 and mitschabaude committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    f6e43a2 View commit details
    Browse the repository at this point in the history
  2. Update src/lib/gadgets/gadgets.ts

    Co-authored-by: Gregor Mitscha-Baude <gregor.mitscha-baude@gmx.at>
    Trivo25 and mitschabaude committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    89d806b View commit details
    Browse the repository at this point in the history
  3. Update src/lib/gadgets/gadgets.ts

    Co-authored-by: Gregor Mitscha-Baude <gregor.mitscha-baude@gmx.at>
    Trivo25 and mitschabaude committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    72d38b4 View commit details
    Browse the repository at this point in the history
  4. address feedback

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    84f0823 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'feature/gadgets-uint' of https://github.com/o1-labs/o1js

    …into feature/gadgets-uint
    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    d790149 View commit details
    Browse the repository at this point in the history
  6. fix changelog

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    cf16482 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2042e02 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b97c717 View commit details
    Browse the repository at this point in the history
  9. fix vk tests

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    973a366 View commit details
    Browse the repository at this point in the history
  10. remove constant check for now

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    1165c5f View commit details
    Browse the repository at this point in the history
  11. add left shift(temp)

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    8cefdbb View commit details
    Browse the repository at this point in the history
  12. remove debug code

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    6da47bd View commit details
    Browse the repository at this point in the history
  13. fix tests

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    2f18e5f View commit details
    Browse the repository at this point in the history
  14. handle constant case

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    1b3ce9b View commit details
    Browse the repository at this point in the history
  15. fix tests

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    ff91e1d View commit details
    Browse the repository at this point in the history
  16. undo spacing in example

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    a0f1e5e View commit details
    Browse the repository at this point in the history
  17. fix compile issue

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    de71797 View commit details
    Browse the repository at this point in the history
  18. clean up

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    fb2aabd View commit details
    Browse the repository at this point in the history
  19. doc comment fix

    Trivo25 committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    b3d74df View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. Configuration menu
    Copy the full SHA
    12942ed View commit details
    Browse the repository at this point in the history
  2. return UInt instead of field

    Trivo25 committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    cfa4883 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9702793 View commit details
    Browse the repository at this point in the history
  4. fix doc comment

    Trivo25 committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    7b5e8fa View commit details
    Browse the repository at this point in the history
  5. remove unused imports

    Trivo25 committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    673c822 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. resolve dependency issue

    Trivo25 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    108513c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fc70678 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a8ff0aa View commit details
    Browse the repository at this point in the history
  4. changelog

    Trivo25 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    d4f27be View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c1e6087 View commit details
    Browse the repository at this point in the history
  6. fix correct bindings

    Trivo25 committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    e2785ab View commit details
    Browse the repository at this point in the history