Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Aug 20, 2023
0 parents commit d504837
Show file tree
Hide file tree
Showing 33 changed files with 1,763 additions and 0 deletions.
31 changes: 31 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
DHARMA License

Copyright (c) 2005—2023 Synrc Research

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

YOU CANNOT USE THIS SOFTWARE IN ANY (PROVABLE BY MONEY TRACE)
PROCESS CHAIN OF EXTERMINATING UKRAINIANS BY ANY MEANS OF FASCIST
ACTIONS AGAINST OUR TERRITORIAL INTEGRITY, CULTURAL DIVERSITY BY
APPLYING MILITARY INVASIONS, ECONOMICAL WARS, HUMANITARIAN DISASTERS,
ARTFICIAL HOLODOMORS, GENOCIDE, RAPING, LOOTING, ROBBERIES, SPREADING
FAKE INFORMATION, AND OTHER CONTEMPORARY WEAPONS OF WAR AT SCALE
OR IN INVIDIVUAL MANNER.

YOU CANNOT USE THIS SOFTWARE BY ANY MEANS IN INTEREST OF LEGAL
ENTITIES OR INDIVIDUALS WHO IS SUPPORTING NOW OR WAS SUPPORTING
BACK THEN FASCISM, RUSCISM, COMMUNISM, CHAUVINISM, HUMILIATION,
AND OTHER SUPPRESSIVE IDEOLOGIES IN DIFFERENT EXPRESSIONS.

STOP KILLING UKRAINIANS,
THE COUNTER RENDERS TENS OF MILLIONS.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26 changes: 26 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version: 5.8

import PackageDescription
import class Foundation.ProcessInfo

let package = Package(
name: "chat-asn1",
platforms: [ .macOS(.v12), .iOS(.v13) ],
products: [ .executable(name: "chat-asn1", targets: ["ASN1SCG"]), ],
targets: [
.executableTarget(
name: "ASN1SCG",
dependencies: [
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "_CryptoExtras", package: "swift-crypto"),
.product(name: "SwiftASN1", package: "swift-asn1"),
]),
]
)

if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-crypto.git", from: "2.6.0"),
.package(url: "https://github.com/apple/swift-asn1.git", from: "0.8.0"),
]
}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SYNRC 💬 ASN.1
==============

ASN.1 Swift Code Generation Compiler.

Credits
-------

* Namdak Tonpa

OM A HUM
33 changes: 33 additions & 0 deletions Sources/ASN1SCG/A.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline indirect enum A: DERParseable, DERSerializable, Hashable, Sendable {
case v(V)
case list_x(List)
@inlinable init(derEncoded rootNode: ASN1Node) throws {
switch rootNode.identifier {
case V.defaultIdentifier:
self = .v(try V(derEncoded: rootNode))
case List.defaultIdentifier:
self = .list_x(try List(derEncoded: rootNode))
default: throw ASN1Error.unexpectedFieldType(rootNode.identifier)
}
}
@inlinable func serialize(into coder: inout DER.Serializer) throws {
switch self {
case .v(let v):
try coder.appendConstructedNode(
identifier: ASN1Identifier(tagWithNumber: 0, tagClass: .contextSpecific),
{ coder in try coder.serialize(v) })
case .list_x(let list_x):
try coder.appendConstructedNode(
identifier: ASN1Identifier(tagWithNumber: 1, tagClass: .contextSpecific),
{ coder in try coder.serialize(list_x) })
}
}

}
31 changes: 31 additions & 0 deletions Sources/ASN1SCG/AddRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct AddRequest: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var entry: ASN1OctetString
@usableFromInline var attributes: AttributeList
@inlinable init(entry: ASN1OctetString, attributes: AttributeList) {
self.entry = entry
self.attributes = attributes
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let entry = try ASN1OctetString(derEncoded: &nodes)
let attributes = try AttributeList(derEncoded: &nodes)
return AddRequest(entry: entry, attributes: attributes)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.entry)
try coder.serialize(self.attributes)
}
}
}
31 changes: 31 additions & 0 deletions Sources/ASN1SCG/AttributeValueAssertion.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct AttributeValueAssertion: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var attributeDesc: ASN1OctetString
@usableFromInline var assertionValue: ASN1OctetString
@inlinable init(attributeDesc: ASN1OctetString, assertionValue: ASN1OctetString) {
self.attributeDesc = attributeDesc
self.assertionValue = assertionValue
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let attributeDesc = try ASN1OctetString(derEncoded: &nodes)
let assertionValue = try ASN1OctetString(derEncoded: &nodes)
return AttributeValueAssertion(attributeDesc: attributeDesc, assertionValue: assertionValue)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.attributeDesc)
try coder.serialize(self.assertionValue)
}
}
}
35 changes: 35 additions & 0 deletions Sources/ASN1SCG/AuthenticationChoice.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline indirect enum AuthenticationChoice: DERParseable, DERSerializable, Hashable, Sendable {
case simple(ASN1OctetString)
case sasl(SaslCredentials)
@inlinable init(derEncoded rootNode: ASN1Node) throws {
switch rootNode.identifier {
case ASN1OctetString.defaultIdentifier:
self = .simple(try ASN1OctetString(derEncoded: rootNode))
case SaslCredentials.defaultIdentifier:
self = .sasl(try SaslCredentials(derEncoded: rootNode))

default: throw ASN1Error.unexpectedFieldType(rootNode.identifier)
}
}
@inlinable func serialize(into coder: inout DER.Serializer) throws {
switch self {
case .simple(let simple):
try coder.appendConstructedNode(
identifier: ASN1Identifier(tagWithNumber: 0, tagClass: .contextSpecific),
{ coder in try coder.serialize(simple) })
case .sasl(let sasl):
try coder.appendConstructedNode(
identifier: ASN1Identifier(tagWithNumber: 3, tagClass: .contextSpecific),
{ coder in try coder.serialize(sasl) })

}
}

}
35 changes: 35 additions & 0 deletions Sources/ASN1SCG/BindRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct BindRequest: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var version: ArraySlice<UInt8>
@usableFromInline var name: ASN1OctetString
@usableFromInline var authentication: AuthenticationChoice
@inlinable init(version: ArraySlice<UInt8>, name: ASN1OctetString, authentication: AuthenticationChoice) {
self.version = version
self.name = name
self.authentication = authentication
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let version = try ArraySlice<UInt8>(derEncoded: &nodes)
let name = try ASN1OctetString(derEncoded: &nodes)
let authentication = try AuthenticationChoice(derEncoded: &nodes)
return BindRequest(version: version, name: name, authentication: authentication)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.version)
try coder.serialize(self.name)
try coder.serialize(self.authentication)
}
}
}
30 changes: 30 additions & 0 deletions Sources/ASN1SCG/BindResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct BindResponse: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var serverSaslCreds: ASN1OctetString
@inlinable init(, serverSaslCreds: ASN1OctetString) {

self.serverSaslCreds = serverSaslCreds
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in

let serverSaslCreds = try ASN1OctetString(derEncoded: &nodes)
return BindResponse(, serverSaslCreds: serverSaslCreds)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in

try coder.serialize(self.serverSaslCreds)
}
}
}
31 changes: 31 additions & 0 deletions Sources/ASN1SCG/CompareRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct CompareRequest: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var entry: ASN1OctetString
@usableFromInline var ava: AttributeValueAssertion
@inlinable init(entry: ASN1OctetString, ava: AttributeValueAssertion) {
self.entry = entry
self.ava = ava
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let entry = try ASN1OctetString(derEncoded: &nodes)
let ava = try AttributeValueAssertion(derEncoded: &nodes)
return CompareRequest(entry: entry, ava: ava)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.entry)
try coder.serialize(self.ava)
}
}
}
35 changes: 35 additions & 0 deletions Sources/ASN1SCG/Control.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct Control: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var controlType: ASN1OctetString
@usableFromInline var criticality: Bool
@usableFromInline var controlValue: ASN1OctetString
@inlinable init(controlType: ASN1OctetString, criticality: Bool, controlValue: ASN1OctetString) {
self.controlType = controlType
self.criticality = criticality
self.controlValue = controlValue
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let controlType = try ASN1OctetString(derEncoded: &nodes)
let criticality = try Bool(derEncoded: &nodes)
let controlValue = try ASN1OctetString(derEncoded: &nodes)
return Control(controlType: controlType, criticality: criticality, controlValue: controlValue)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.controlType)
try coder.serialize(self.criticality)
try coder.serialize(self.controlValue)
}
}
}
31 changes: 31 additions & 0 deletions Sources/ASN1SCG/ExtendedRequest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is autogenerated by ASN1.ERP.UNO. Do not edit.

import ASN1SCG
import SwiftASN1
import Crypto
import Foundation

@usableFromInline struct ExtendedRequest: DERImplicitlyTaggable, Hashable, Sendable {
@inlinable static var defaultIdentifier: ASN1Identifier { .sequence }
@usableFromInline var requestName: ASN1OctetString
@usableFromInline var requestValue: ASN1OctetString
@inlinable init(requestName: ASN1OctetString, requestValue: ASN1OctetString) {
self.requestName = requestName
self.requestValue = requestValue
}
@inlinable init(derEncoded root: ASN1Node,
withIdentifier identifier: ASN1Identifier) throws {
self = try DER.sequence(root, identifier: identifier) { nodes in
let requestName = try ASN1OctetString(derEncoded: &nodes)
let requestValue = try ASN1OctetString(derEncoded: &nodes)
return ExtendedRequest(requestName: requestName, requestValue: requestValue)
}
}
@inlinable func serialize(into coder: inout DER.Serializer,
withIdentifier identifier: ASN1Identifier) throws {
try coder.appendConstructedNode(identifier: identifier) { coder in
try coder.serialize(self.requestName)
try coder.serialize(self.requestValue)
}
}
}
Loading

0 comments on commit d504837

Please sign in to comment.