-
Notifications
You must be signed in to change notification settings - Fork 122
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
Integer rings (Zq and instantiation for Labrador protocol) #769
Conversation
391518d
to
d6c72e3
Compare
7b4a8d8
to
adeee6f
Compare
adeee6f
to
930f252
Compare
friend HOST_DEVICE bool operator!=(const Derived& xs, const Derived& ys) { return !(xs == ys); } | ||
|
||
template <typename Gen, bool IS_3B = false> | ||
static HOST_DEVICE_INLINE Derived mul_weierstrass_b(const Derived& xs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should move to field or change the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it to projective class. It actually doesn't belong to field not ring. Agree?
I mean this weistrass-b is a curve parameter, has nothing to do with field type
|
||
static constexpr HOST_DEVICE_INLINE bool is_even(const Derived& xs) { return ~xs.limbs_storage.limbs[0] & 1; } | ||
|
||
static constexpr HOST_DEVICE Derived inverse(const Derived& xs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to field.
In ring there should be a different functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break code like NTT though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we agreed to keep it as is. Inverse returns 0 if no inverse exists
return hash; | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the inverse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently it's in the base class
icicle/tests/test_ring_api.cpp
Outdated
|
||
// Add ring specific tests here | ||
|
||
// TYPED_TEST(RingAndFieldTest, /*Test Name*/) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a test for the dedicated ring invers is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently shared with field. I will have to split them yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split them
icicle/tests/test_ring_field.h
Outdated
ASSERT_EQ(0, memcmp(out_main.get(), out_ref.get(), batch_size * sizeof(int64_t))); | ||
} | ||
|
||
TEST_F(RingAndFieldTestBase, polynomialEval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a meaning for that here? should move to field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works and does not rely on inverse so I think let's keep it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the comments are about the field-ring separation at the tests.
Also ring::inverse should have a different function - probably different signature
I am not sure it this is a good idea to make it different as it will break code such as NTT that relies on NTT. |
dd3962a
to
63b58d9
Compare
This PR introduces integer rings to ICICLE infrastructure.
NOTE: this PR is very large in terms of changed lines, but this it mostly code that moved due to sharing of code between finite-fields and integer-rings.
Future PRs will add
cuda-backend-branch: yshekel/rings