Skip to content

Commit

Permalink
move test to utils (#143)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruiyu Zhu <[email protected]>
  • Loading branch information
fboemer and RuiyuZhu authored Jan 10, 2025
1 parent 25108c4 commit d9d5674
Show file tree
Hide file tree
Showing 3 changed files with 1,119 additions and 200 deletions.
6 changes: 3 additions & 3 deletions Sources/HomomorphicEncryption/Ciphertext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public struct Ciphertext<Scheme: HeScheme, Format: PolyFormat>: Equatable, Sendable {
/// Context for HE computation.
public let context: Context<Scheme>
@usableFromInline var polys: [PolyRq<Scheme.Scalar, Format>]
@usableFromInline package var polys: [PolyRq<Scheme.Scalar, Format>]
@usableFromInline var correctionFactor: Scheme.Scalar
@usableFromInline var seed: [UInt8] = []

Expand Down Expand Up @@ -161,13 +161,13 @@ public struct Ciphertext<Scheme: HeScheme, Format: PolyFormat>: Equatable, Senda
}

@inlinable
func forwardNtt() throws -> Ciphertext<Scheme, Eval> where Format == Coeff {
package func forwardNtt() throws -> Ciphertext<Scheme, Eval> where Format == Coeff {
let polys = try polys.map { try $0.forwardNtt() }
return Ciphertext<Scheme, Eval>(context: context, polys: polys, correctionFactor: correctionFactor, seed: seed)
}

@inlinable
func inverseNtt() throws -> Ciphertext<Scheme, Coeff> where Format == Eval {
package func inverseNtt() throws -> Ciphertext<Scheme, Coeff> where Format == Eval {
let polys = try polys.map { try $0.inverseNtt() }
return Ciphertext<Scheme, Coeff>(context: context, polys: polys, correctionFactor: correctionFactor, seed: seed)
}
Expand Down
Loading

0 comments on commit d9d5674

Please sign in to comment.