Skip to content

Commit

Permalink
feat(didcomm): added support for optional chachapoly
Browse files Browse the repository at this point in the history
  • Loading branch information
beatt83 committed Jul 18, 2024
1 parent 9549bd2 commit 923cb18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/swift-libp2p/swift-multibase.git", .upToNextMajor(from: "0.0.1")),
.package(url: "https://github.com/beatt83/didcore-swift.git", .upToNextMinor(from: "2.0.0")),
.package(url: "https://github.com/beatt83/jose-swift.git", .upToNextMajor(from: "3.1.0"))
.package(url: "https://github.com/beatt83/jose-swift.git", .upToNextMajor(from: "3.2.0"))
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dependencies: [
|---------------|------------------|
| A256CBC-HS512 |:white_check_mark:|
| A256GCM |:white_check_mark:|
| XC20P | |
| XC20P |:white_check_mark:|

</td><td valign="top">

Expand Down
4 changes: 3 additions & 1 deletion Sources/DIDCommSwift/Helper/AnonAlg+JWE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension AnonymousEncryptionAlgorithms {
case .a256GCM:
return (ContentEncryptionAlgorithm.a256GCM, KeyManagementAlgorithm.ecdhESA256KW)
case .XC20P:
fatalError("This is not supported")
return (ContentEncryptionAlgorithm.xC20PKW, KeyManagementAlgorithm.ecdhESA256KW)
}
}

Expand All @@ -35,6 +35,8 @@ extension AnonymousEncryptionAlgorithms {
return .a256CBCHS512
case (.ecdhESA256KW, .a256GCM):
return .a256GCM
case (.ecdhESA256KW, .xC20PKW):
return .XC20P
default:
throw DIDCommError.unsupportedCryptoAlgorithme(algorithm: keyAlg.rawValue, encoding: encAlg.rawValue)
}
Expand Down

0 comments on commit 923cb18

Please sign in to comment.