Skip to content

Commit

Permalink
Make Plaintext.poly internal (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
fboemer authored Sep 17, 2024
1 parent b4ccb96 commit 7299838
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
6 changes: 2 additions & 4 deletions Sources/HomomorphicEncryption/Encoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ extension Context {
/// - values: Values to encode.
/// - format: Encoding format.
/// - moduliCount: Optional number of moduli. If not set, encoding will use the top-level ciphertext context with
/// all the
/// moduli.
/// all the moduli.
/// - Returns: The plaintext encoding `values`.
/// - Throws: Error upon failure to encode.
@inlinable
Expand All @@ -83,8 +82,7 @@ extension Context {
/// - signedValues: Signed values to encode.
/// - format: Encoding format.
/// - moduliCount: Optional number of moduli. If not set, encoding will use the top-level ciphertext context with
/// all the
/// moduli.
/// all the moduli.
/// - Returns: The plaintext encoding `signedValues`.
/// - Throws: Error upon failure to encode.
@inlinable
Expand Down
6 changes: 2 additions & 4 deletions Sources/HomomorphicEncryption/HeScheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ public protocol HeScheme {
/// - values: Values to encode.
/// - format: Encoding format.
/// - moduliCount: Optional number of moduli. If not set, encoding will use the top-level ciphertext context with
/// all the
/// moduli.
/// all the moduli.
/// - Returns: A plaintext encoding `values`.
/// - Throws: Error upon failure to encode.
/// - seealso: ``Context/encode(values:format:moduliCount:)`` for an alternative API.
Expand All @@ -213,8 +212,7 @@ public protocol HeScheme {
/// - signedValues: Signed values to encode.
/// - format: Encoding format.
/// - moduliCount: Optional number of moduli. If not set, encoding will use the top-level ciphertext context with
/// all the
/// moduli.
/// all the moduli.
/// - Returns: A plaintext encoding `signedValues`.
/// - Throws: Error upon failure to encode.
/// - seealso: ``Context/encode(signedValues:format:moduliCount:)`` for an alternative API.
Expand Down
2 changes: 1 addition & 1 deletion Sources/HomomorphicEncryption/Plaintext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct Plaintext<Scheme: HeScheme, Format: PolyFormat>: Equatable, Sendab
/// Context for HE computation.
public let context: Context<Scheme>

@usableFromInline package var poly: PolyRq<Scalar, Format>
@usableFromInline var poly: PolyRq<Scalar, Format>

@inlinable
package init(context: Context<Scheme>, poly: PolyRq<Scalar, Format>) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/HomomorphicEncryption/SerializedCiphertext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension Ciphertext {
/// - serialized: Serialized ciphertext.
/// - context: Context to associate with the ciphertext.
/// - moduliCount: Number of moduli in the serialized ciphertext. If not set, deserialization will use the
/// top-level ciphertext with all the moduli.
/// top-level ciphertext context with all the moduli.
/// - Throws: Error upon failure to deserialize the ciphertext.
@inlinable
public init(
Expand Down
2 changes: 1 addition & 1 deletion Sources/PrivateInformationRetrieval/IndexPirProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public struct ProcessedDatabase<Scheme: HeScheme>: Equatable, Sendable {
for plaintext in plaintexts {
if let plaintext {
buffer.append(Self.serializedPlaintextTag)
buffer += plaintext.poly.serialize()
buffer += plaintext.serialize().poly
} else {
buffer.append(Self.serializedZeroPlaintextTag)
}
Expand Down

0 comments on commit 7299838

Please sign in to comment.