Skip to content

Commit

Permalink
move test to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiyuZhu authored and fboemer committed Jan 7, 2025
1 parent c19c3b0 commit 6b895ff
Show file tree
Hide file tree
Showing 3 changed files with 1,120 additions and 202 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 6b895ff

Please sign in to comment.