mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 20:32:34 +00:00
Use thiserror for error handling with less boilerplate
This commit is contained in:
@@ -169,7 +169,7 @@ impl BitArray {
|
||||
pub fn setRange(&mut self, start: usize, end: usize) -> Result<()> {
|
||||
let mut end = end;
|
||||
if end < start || end > self.size {
|
||||
return Err(Exceptions::illegalArgument);
|
||||
return Err(Exceptions::ILLEGAL_ARGUMENT);
|
||||
}
|
||||
if end == start {
|
||||
return Ok(());
|
||||
@@ -212,7 +212,7 @@ impl BitArray {
|
||||
pub fn isRange(&self, start: usize, end: usize, value: bool) -> Result<bool> {
|
||||
let mut end = end;
|
||||
if end < start || end > self.size {
|
||||
return Err(Exceptions::illegalArgument);
|
||||
return Err(Exceptions::ILLEGAL_ARGUMENT);
|
||||
}
|
||||
if end == start {
|
||||
return Ok(true); // empty range matches
|
||||
@@ -254,7 +254,7 @@ impl BitArray {
|
||||
*/
|
||||
pub fn appendBits(&mut self, value: u32, num_bits: usize) -> Result<()> {
|
||||
if num_bits > 32 {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"num bits must be between 0 and 32",
|
||||
));
|
||||
}
|
||||
@@ -287,7 +287,7 @@ impl BitArray {
|
||||
|
||||
pub fn xor(&mut self, other: &BitArray) -> Result<()> {
|
||||
if self.size != other.size {
|
||||
return Err(Exceptions::illegalArgumentWith("Sizes don't match"));
|
||||
return Err(Exceptions::illegal_argument_with("Sizes don't match"));
|
||||
}
|
||||
for i in 0..self.bits.len() {
|
||||
//for (int i = 0; i < bits.length; i++) {
|
||||
|
||||
@@ -66,7 +66,7 @@ impl BitMatrix {
|
||||
*/
|
||||
pub fn new(width: u32, height: u32) -> Result<Self> {
|
||||
if width < 1 || height < 1 {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"Both dimensions must be greater than 0",
|
||||
));
|
||||
}
|
||||
@@ -138,12 +138,12 @@ impl BitMatrix {
|
||||
if string_representation
|
||||
.chars()
|
||||
.nth(pos)
|
||||
.ok_or(Exceptions::illegalState)?
|
||||
.ok_or(Exceptions::ILLEGAL_STATE)?
|
||||
== '\n'
|
||||
|| string_representation
|
||||
.chars()
|
||||
.nth(pos)
|
||||
.ok_or(Exceptions::illegalState)?
|
||||
.ok_or(Exceptions::ILLEGAL_STATE)?
|
||||
== '\r'
|
||||
{
|
||||
if bitsPos > rowStartPos {
|
||||
@@ -152,7 +152,7 @@ impl BitMatrix {
|
||||
first_run = false;
|
||||
rowLength = bitsPos - rowStartPos;
|
||||
} else if bitsPos - rowStartPos != rowLength {
|
||||
return Err(Exceptions::illegalArgumentWith("row lengths do not match"));
|
||||
return Err(Exceptions::illegal_argument_with("row lengths do not match"));
|
||||
}
|
||||
rowStartPos = bitsPos;
|
||||
nRows += 1;
|
||||
@@ -167,7 +167,7 @@ impl BitMatrix {
|
||||
bits[bitsPos] = false;
|
||||
bitsPos += 1;
|
||||
} else {
|
||||
return Err(Exceptions::illegalArgumentWith(format!(
|
||||
return Err(Exceptions::illegal_argument_with(format!(
|
||||
"illegal character encountered: {}",
|
||||
string_representation[pos..].to_owned()
|
||||
)));
|
||||
@@ -181,7 +181,7 @@ impl BitMatrix {
|
||||
// first_run = false;
|
||||
rowLength = bitsPos - rowStartPos;
|
||||
} else if bitsPos - rowStartPos != rowLength {
|
||||
return Err(Exceptions::illegalArgumentWith("row lengths do not match"));
|
||||
return Err(Exceptions::illegal_argument_with("row lengths do not match"));
|
||||
}
|
||||
nRows += 1;
|
||||
}
|
||||
@@ -308,7 +308,7 @@ impl BitMatrix {
|
||||
pub fn xor(&mut self, mask: &BitMatrix) -> Result<()> {
|
||||
if self.width != mask.width || self.height != mask.height || self.row_size != mask.row_size
|
||||
{
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"input matrix dimensions do not match",
|
||||
));
|
||||
}
|
||||
@@ -354,14 +354,14 @@ impl BitMatrix {
|
||||
// ));
|
||||
// }
|
||||
if height < 1 || width < 1 {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"height and width must be at least 1",
|
||||
));
|
||||
}
|
||||
let right = left + width;
|
||||
let bottom = top + height;
|
||||
if bottom > self.height || right > self.width {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"the region must fit inside the matrix",
|
||||
));
|
||||
}
|
||||
@@ -435,7 +435,7 @@ impl BitMatrix {
|
||||
self.rotate180();
|
||||
Ok(())
|
||||
}
|
||||
_ => Err(Exceptions::illegalArgumentWith(
|
||||
_ => Err(Exceptions::illegal_argument_with(
|
||||
"degrees must be a multiple of 0, 90, 180, or 270",
|
||||
)),
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ impl BitSource {
|
||||
*/
|
||||
pub fn readBits(&mut self, numBits: usize) -> Result<u32> {
|
||||
if !(1..=32).contains(&numBits) || numBits > self.available() {
|
||||
return Err(Exceptions::illegalArgumentWith(numBits.to_string()));
|
||||
return Err(Exceptions::illegal_argument_with(numBits.to_string()));
|
||||
}
|
||||
|
||||
let mut result: u32 = 0;
|
||||
|
||||
@@ -245,7 +245,7 @@ impl CharacterSetECI {
|
||||
28 => Ok(CharacterSetECI::Big5),
|
||||
29 => Ok(CharacterSetECI::GB18030),
|
||||
30 => Ok(CharacterSetECI::EUC_KR),
|
||||
_ => Err(Exceptions::notFoundWith("Bad ECI Value")),
|
||||
_ => Err(Exceptions::not_found_with("Bad ECI Value")),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ impl GridSampler for DefaultGridSampler {
|
||||
transform: &PerspectiveTransform,
|
||||
) -> Result<BitMatrix> {
|
||||
if dimensionX == 0 || dimensionY == 0 {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
let mut bits = BitMatrix::new(dimensionX, dimensionY)?;
|
||||
let mut points = vec![0.0; 2 * dimensionX as usize];
|
||||
@@ -99,7 +99,7 @@ impl GridSampler for DefaultGridSampler {
|
||||
// }
|
||||
if image
|
||||
.try_get(points[x] as u32, points[x + 1] as u32)
|
||||
.ok_or(Exceptions::notFoundWith(
|
||||
.ok_or(Exceptions::not_found_with(
|
||||
"index out of bounds, see documentation in file for explanation",
|
||||
))?
|
||||
{
|
||||
|
||||
@@ -203,13 +203,13 @@ impl<'a> MonochromeRectangleDetector<'_> {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
lastRange_z = range;
|
||||
y += deltaY;
|
||||
x += deltaX
|
||||
}
|
||||
Err(Exceptions::notFound)
|
||||
Err(Exceptions::NOT_FOUND)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,7 +78,7 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
|| downInit >= image.getHeight() as i32
|
||||
|| rightInit >= image.getWidth() as i32
|
||||
{
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
Ok(WhiteRectangleDetector {
|
||||
@@ -224,7 +224,7 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
}
|
||||
|
||||
if z.is_none() {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
let mut t: Option<Point> = None;
|
||||
@@ -242,7 +242,7 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
}
|
||||
|
||||
if t.is_none() {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
let mut x: Option<Point> = None;
|
||||
@@ -260,7 +260,7 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
}
|
||||
|
||||
if x.is_none() {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
let mut y: Option<Point> = None;
|
||||
@@ -278,12 +278,12 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
}
|
||||
|
||||
if y.is_none() {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
Ok(self.center_edges(y.unwrap(), z.unwrap(), x.unwrap(), t.unwrap()))
|
||||
} else {
|
||||
Err(Exceptions::notFound)
|
||||
Err(Exceptions::NOT_FOUND)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ impl GlobalHistogramBinarizer {
|
||||
// If there is too little contrast in the image to pick a meaningful black point, throw rather
|
||||
// than waste time trying to decode the image, and risk false positives.
|
||||
if secondPeak - firstPeak <= numBuckets / 16 {
|
||||
return Err(Exceptions::notFoundWith(
|
||||
return Err(Exceptions::not_found_with(
|
||||
"secondPeak - firstPeak <= numBuckets / 16 ",
|
||||
));
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ pub trait GridSampler {
|
||||
let x = points[offset] as i32;
|
||||
let y = points[offset + 1] as i32;
|
||||
if x < -1 || x > width as i32 || y < -1 || y > height as i32 {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
nudged = false;
|
||||
if x == -1 {
|
||||
@@ -173,7 +173,7 @@ pub trait GridSampler {
|
||||
let x = points[offset as usize] as i32;
|
||||
let y = points[offset as usize + 1] as i32;
|
||||
if x < -1 || x > width as i32 || y < -1 || y > height as i32 {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
nudged = false;
|
||||
if x == -1 {
|
||||
|
||||
@@ -68,10 +68,10 @@ impl ECIInput for MinimalECIInput {
|
||||
*/
|
||||
fn charAt(&self, index: usize) -> Result<char> {
|
||||
if index >= self.length() {
|
||||
return Err(Exceptions::indexOutOfBoundsWith(index.to_string()));
|
||||
return Err(Exceptions::index_out_of_bounds_with(index.to_string()));
|
||||
}
|
||||
if self.isECI(index as u32)? {
|
||||
return Err(Exceptions::illegalArgumentWith(format!(
|
||||
return Err(Exceptions::illegal_argument_with(format!(
|
||||
"value at {index} is not a character but an ECI"
|
||||
)));
|
||||
}
|
||||
@@ -104,13 +104,13 @@ impl ECIInput for MinimalECIInput {
|
||||
*/
|
||||
fn subSequence(&self, start: usize, end: usize) -> Result<Vec<char>> {
|
||||
if start > end || end > self.length() {
|
||||
return Err(Exceptions::indexOutOfBounds);
|
||||
return Err(Exceptions::INDEX_OUT_OF_BOUNDS);
|
||||
}
|
||||
let mut result = String::new();
|
||||
for i in start..end {
|
||||
// for (int i = start; i < end; i++) {
|
||||
if self.isECI(i as u32)? {
|
||||
return Err(Exceptions::illegalArgumentWith(format!(
|
||||
return Err(Exceptions::illegal_argument_with(format!(
|
||||
"value at {i} is not a character but an ECI"
|
||||
)));
|
||||
}
|
||||
@@ -132,7 +132,7 @@ impl ECIInput for MinimalECIInput {
|
||||
*/
|
||||
fn isECI(&self, index: u32) -> Result<bool> {
|
||||
if index >= self.length() as u32 {
|
||||
return Err(Exceptions::indexOutOfBounds);
|
||||
return Err(Exceptions::INDEX_OUT_OF_BOUNDS);
|
||||
}
|
||||
Ok(self.bytes[index as usize] > 255) // && self.bytes[index as usize] <= u16::MAX)
|
||||
}
|
||||
@@ -157,10 +157,10 @@ impl ECIInput for MinimalECIInput {
|
||||
*/
|
||||
fn getECIValue(&self, index: usize) -> Result<i32> {
|
||||
if index >= self.length() {
|
||||
return Err(Exceptions::indexOutOfBounds);
|
||||
return Err(Exceptions::INDEX_OUT_OF_BOUNDS);
|
||||
}
|
||||
if !self.isECI(index as u32)? {
|
||||
return Err(Exceptions::illegalArgumentWith(format!(
|
||||
return Err(Exceptions::illegal_argument_with(format!(
|
||||
"value at {index} is not an ECI but a character"
|
||||
)));
|
||||
}
|
||||
@@ -249,7 +249,7 @@ impl MinimalECIInput {
|
||||
*/
|
||||
pub fn isFNC1(&self, index: usize) -> Result<bool> {
|
||||
if index >= self.length() {
|
||||
return Err(Exceptions::indexOutOfBounds);
|
||||
return Err(Exceptions::INDEX_OUT_OF_BOUNDS);
|
||||
}
|
||||
Ok(self.bytes[index] == 1000)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ impl OtsuLevelBinarizer {
|
||||
fn generate_threshold_matrix(source: &dyn LuminanceSource) -> Result<BitMatrix> {
|
||||
let image_buffer = {
|
||||
let Some(buff) : Option<ImageBuffer<Luma<u8>,Vec<u8>>> = ImageBuffer::from_vec(source.getWidth() as u32, source.getHeight() as u32, source.getMatrix()) else {
|
||||
return Err(Exceptions::illegalArgument)
|
||||
return Err(Exceptions::ILLEGAL_ARGUMENT)
|
||||
};
|
||||
buff
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ impl GenericGF {
|
||||
*/
|
||||
pub fn log(&self, a: i32) -> Result<i32> {
|
||||
if a == 0 {
|
||||
return Err(Exceptions::illegalArgument);
|
||||
return Err(Exceptions::ILLEGAL_ARGUMENT);
|
||||
}
|
||||
// let pos: usize = a.try_into().unwrap();
|
||||
Ok(self.logTable[a as usize])
|
||||
@@ -145,7 +145,7 @@ impl GenericGF {
|
||||
*/
|
||||
pub fn inverse(&self, a: i32) -> Result<i32> {
|
||||
if a == 0 {
|
||||
return Err(Exceptions::arithmetic);
|
||||
return Err(Exceptions::ARITHMETIC);
|
||||
}
|
||||
let log_t_loc: usize = a as usize;
|
||||
let loc: usize = ((self.size as i32) - self.logTable[log_t_loc] - 1) as usize;
|
||||
|
||||
@@ -50,7 +50,7 @@ impl GenericGFPoly {
|
||||
*/
|
||||
pub fn new(field: GenericGFRef, coefficients: &[i32]) -> Result<Self> {
|
||||
if coefficients.is_empty() {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"coefficients cannot be empty",
|
||||
));
|
||||
}
|
||||
@@ -141,7 +141,7 @@ impl GenericGFPoly {
|
||||
|
||||
pub fn addOrSubtract(&self, other: &GenericGFPoly) -> Result<GenericGFPoly> {
|
||||
if self.field != other.field {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"GenericGFPolys do not have same GenericGF field",
|
||||
));
|
||||
}
|
||||
@@ -178,7 +178,7 @@ impl GenericGFPoly {
|
||||
pub fn multiply(&self, other: &GenericGFPoly) -> Result<GenericGFPoly> {
|
||||
if self.field != other.field {
|
||||
//if (!field.equals(other.field)) {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"GenericGFPolys do not have same GenericGF field",
|
||||
));
|
||||
}
|
||||
@@ -246,12 +246,12 @@ impl GenericGFPoly {
|
||||
|
||||
pub fn divide(&self, other: &GenericGFPoly) -> Result<(GenericGFPoly, GenericGFPoly)> {
|
||||
if self.field != other.field {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"GenericGFPolys do not have same GenericGF field",
|
||||
));
|
||||
}
|
||||
if other.isZero() {
|
||||
return Err(Exceptions::illegalArgumentWith("Divide by 0"));
|
||||
return Err(Exceptions::illegal_argument_with("Divide by 0"));
|
||||
}
|
||||
|
||||
let mut quotient = self.getZero();
|
||||
@@ -260,7 +260,7 @@ impl GenericGFPoly {
|
||||
let denominator_leading_term = other.getCoefficient(other.getDegree());
|
||||
let inverse_denominator_leading_term = match self.field.inverse(denominator_leading_term) {
|
||||
Ok(val) => val,
|
||||
Err(_issue) => return Err(Exceptions::illegalArgumentWith("arithmetic issue")),
|
||||
Err(_issue) => return Err(Exceptions::illegal_argument_with("arithmetic issue")),
|
||||
};
|
||||
|
||||
while remainder.getDegree() >= other.getDegree() && !remainder.isZero() {
|
||||
|
||||
@@ -78,7 +78,7 @@ impl ReedSolomonDecoder {
|
||||
return Ok(0);
|
||||
}
|
||||
let Ok(syndrome) = GenericGFPoly::new(self.field, &syndromeCoefficients) else {
|
||||
return Err(Exceptions::reedSolomon);
|
||||
return Err(Exceptions::REED_SOLOMON);
|
||||
};
|
||||
let sigmaOmega = self.runEuclideanAlgorithm(
|
||||
&GenericGF::buildMonomial(self.field, twoS as usize, 1),
|
||||
@@ -93,11 +93,11 @@ impl ReedSolomonDecoder {
|
||||
//for (int i = 0; i < errorLocations.length; i++) {
|
||||
let log_value = self.field.log(errorLocations[i] as i32)?;
|
||||
if log_value > received.len() as i32 - 1 {
|
||||
return Err(Exceptions::reedSolomonWith("Bad error location"));
|
||||
return Err(Exceptions::reed_solomon_with("Bad error location"));
|
||||
}
|
||||
let position: isize = received.len() as isize - 1 - log_value as isize;
|
||||
if position < 0 {
|
||||
return Err(Exceptions::reedSolomonWith("Bad error location"));
|
||||
return Err(Exceptions::reed_solomon_with("Bad error location"));
|
||||
}
|
||||
received[position as usize] =
|
||||
GenericGF::addOrSubtract(received[position as usize], errorMagnitudes[i]);
|
||||
@@ -135,7 +135,7 @@ impl ReedSolomonDecoder {
|
||||
// Divide rLastLast by rLast, with quotient in q and remainder in r
|
||||
if rLast.isZero() {
|
||||
// Oops, Euclidean algorithm already terminated?
|
||||
return Err(Exceptions::reedSolomonWith("r_{i-1} was zero"));
|
||||
return Err(Exceptions::reed_solomon_with("r_{i-1} was zero"));
|
||||
}
|
||||
r = rLastLast;
|
||||
let mut q = r.getZero();
|
||||
@@ -153,7 +153,7 @@ impl ReedSolomonDecoder {
|
||||
t = (q.multiply(&tLast)?).addOrSubtract(&tLastLast)?;
|
||||
|
||||
if r.getDegree() >= rLast.getDegree() {
|
||||
return Err(Exceptions::reedSolomonWith(format!(
|
||||
return Err(Exceptions::reed_solomon_with(format!(
|
||||
"Division algorithm failed to reduce polynomial? r: {r}, rLast: {rLast}"
|
||||
)));
|
||||
}
|
||||
@@ -161,12 +161,12 @@ impl ReedSolomonDecoder {
|
||||
|
||||
let sigmaTildeAtZero = t.getCoefficient(0);
|
||||
if sigmaTildeAtZero == 0 {
|
||||
return Err(Exceptions::reedSolomonWith("sigmaTilde(0) was zero"));
|
||||
return Err(Exceptions::reed_solomon_with("sigmaTilde(0) was zero"));
|
||||
}
|
||||
|
||||
let inverse = match self.field.inverse(sigmaTildeAtZero) {
|
||||
Ok(res) => res,
|
||||
Err(_err) => return Err(Exceptions::reedSolomonWith("ArithmetricException")),
|
||||
Err(_err) => return Err(Exceptions::reed_solomon_with("ArithmetricException")),
|
||||
};
|
||||
let sigma = t.multiply_with_scalar(inverse);
|
||||
let omega = r.multiply_with_scalar(inverse);
|
||||
@@ -194,7 +194,7 @@ impl ReedSolomonDecoder {
|
||||
}
|
||||
}
|
||||
if e != numErrors {
|
||||
return Err(Exceptions::reedSolomonWith(
|
||||
return Err(Exceptions::reed_solomon_with(
|
||||
"Error locator degree does not match number of roots",
|
||||
));
|
||||
}
|
||||
|
||||
@@ -74,11 +74,11 @@ impl ReedSolomonEncoder {
|
||||
|
||||
pub fn encode(&mut self, to_encode: &mut Vec<i32>, ec_bytes: usize) -> Result<()> {
|
||||
if ec_bytes == 0 {
|
||||
return Err(Exceptions::illegalArgumentWith("No error correction bytes"));
|
||||
return Err(Exceptions::illegal_argument_with("No error correction bytes"));
|
||||
}
|
||||
let data_bytes = to_encode.len() - ec_bytes;
|
||||
if data_bytes == 0 {
|
||||
return Err(Exceptions::illegalArgumentWith("No data bytes provided"));
|
||||
return Err(Exceptions::illegal_argument_with("No data bytes provided"));
|
||||
}
|
||||
let fld = self.field;
|
||||
let generator = self.buildGenerator(ec_bytes);
|
||||
@@ -87,7 +87,7 @@ impl ReedSolomonEncoder {
|
||||
//System.arraycopy(toEncode, 0, infoCoefficients, 0, dataBytes);
|
||||
let mut info = GenericGFPoly::new(fld, &info_coefficients)?;
|
||||
info = info.multiply_by_monomial(ec_bytes, 1)?;
|
||||
let remainder = &info.divide(generator.ok_or(Exceptions::reedSolomon)?)?.1;
|
||||
let remainder = &info.divide(generator.ok_or(Exceptions::REED_SOLOMON)?)?.1;
|
||||
let coefficients = remainder.getCoefficients();
|
||||
let num_zero_coefficients = ec_bytes - coefficients.len();
|
||||
for i in 0..num_zero_coefficients {
|
||||
|
||||
Reference in New Issue
Block a user