mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
fix(compiler/midlfhe): Change constraint on operators with integers (just too large integers are forbidden)
This commit is contained in:
@@ -32,8 +32,8 @@ func @add_glwe_int(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>) -> !MidLFHE.glwe<{1024
|
||||
|
||||
// integer width doesn't match GLWE parameter
|
||||
func @add_glwe_int(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>) -> !MidLFHE.glwe<{1024,12,64}{7}> {
|
||||
%0 = constant 1 : i6
|
||||
// expected-error @+1 {{'MidLFHE.add_glwe_int' op should have the width of `b` equals to 'p'+1}}
|
||||
%1 = "MidLFHE.add_glwe_int"(%arg0, %0): (!MidLFHE.glwe<{1024,12,64}{7}>, i6) -> (!MidLFHE.glwe<{1024,12,64}{7}>)
|
||||
%0 = constant 1 : i9
|
||||
// expected-error @+1 {{'MidLFHE.add_glwe_int' op should have the width of `b` equals or less than 'p'+1}}
|
||||
%1 = "MidLFHE.add_glwe_int"(%arg0, %0): (!MidLFHE.glwe<{1024,12,64}{7}>, i9) -> (!MidLFHE.glwe<{1024,12,64}{7}>)
|
||||
return %1: !MidLFHE.glwe<{1024,12,64}{7}>
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ func @apply_lookup_table(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>, %arg1: tensor<4x
|
||||
|
||||
// Bad dimension of integer in the lookup table
|
||||
func @apply_lookup_table(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>, %arg1: tensor<128xi3>) -> !MidLFHE.glwe<{512,10,64}{2}> {
|
||||
// expected-error @+1 {{'MidLFHE.apply_lookup_table' op should have equals width beetwen the encrypted integer result and integers of the `tabulated_lambda` argument}}
|
||||
// expected-error @+1 {{'MidLFHE.apply_lookup_table' op should have the width of the constants less or equals than the precision of the encrypted integer}}
|
||||
%1 = "MidLFHE.apply_lookup_table"(%arg0, %arg1) {k = 1 : i32, polynomialSize = 1024 : i32, levelKS = 2 : i32, baseLogKS = -82 : i32, levelBS = 3 : i32, baseLogBS = -83 : i32}: (!MidLFHE.glwe<{1024,12,64}{7}>, tensor<128xi3>) -> (!MidLFHE.glwe<{512,10,64}{2}>)
|
||||
return %1: !MidLFHE.glwe<{512,10,64}{2}>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ func @mul_glwe_int(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>) -> !MidLFHE.glwe<{1024
|
||||
|
||||
// integer width doesn't match GLWE parameter
|
||||
func @mul_glwe_int(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>) -> !MidLFHE.glwe<{1024,12,64}{7}> {
|
||||
%0 = constant 1 : i6
|
||||
// expected-error @+1 {{'MidLFHE.mul_glwe_int' op should have the width of `b` equals to 'p'+1}}
|
||||
%1 = "MidLFHE.mul_glwe_int"(%arg0, %0): (!MidLFHE.glwe<{1024,12,64}{7}>, i6) -> (!MidLFHE.glwe<{1024,12,64}{7}>)
|
||||
%0 = constant 1 : i9
|
||||
// expected-error @+1 {{'MidLFHE.mul_glwe_int' op should have the width of `b` equals or less than 'p'+1}}
|
||||
%1 = "MidLFHE.mul_glwe_int"(%arg0, %0): (!MidLFHE.glwe<{1024,12,64}{7}>, i9) -> (!MidLFHE.glwe<{1024,12,64}{7}>)
|
||||
return %1: !MidLFHE.glwe<{1024,12,64}{7}>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user