File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Sources/HomomorphicEncryption Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
1+ // Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -96,8 +96,8 @@ public struct Modulus<T: ScalarType>: Equatable, Sendable {
9696 /// - Returns: `x * y mod p`.
9797 @inlinable
9898 public func multiplyMod( _ x: T , _ y: T ) -> T {
99- precondition ( x < modulus)
100- precondition ( y < modulus)
99+ assert ( x < modulus)
100+ assert ( y < modulus)
101101 let product = x. multipliedFullWidth ( by: y)
102102 return reduceProduct ( T . DoubleWidth ( product) )
103103 }
@@ -383,8 +383,8 @@ struct ReduceModulus<T: ScalarType>: Equatable, Sendable {
383383 /// - Returns: `x * y mod p`.
384384 @inlinable
385385 func multiplyMod( _ x: T , _ y: T ) -> T {
386- precondition ( x < modulus)
387- precondition ( y < modulus)
386+ assert ( x < modulus)
387+ assert ( y < modulus)
388388 let product = x. multipliedFullWidth ( by: y)
389389 return reduceProduct ( T . DoubleWidth ( product) )
390390 }
You can’t perform that action at this time.
0 commit comments