-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making enum for shadow-socks ciphers
- Loading branch information
Showing
10 changed files
with
66 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
ios/MullvadVPN/AccessMethodRepository/ShadowsocksCipher.swift
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
ios/MullvadVPN/AccessMethodRepository/ShadowsocksCipherOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// ShadowsocksCipherOptions.swift | ||
// MullvadVPN | ||
// | ||
// Created by pronebird on 13/11/2023. | ||
// Copyright © 2023 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Type representing a shadowsocks cipher. | ||
struct ShadowsocksCipherOptions: RawRepresentable, Codable, Hashable { | ||
let rawValue: CipherIdentifiers | ||
|
||
/// Default cipher. | ||
static let `default` = ShadowsocksCipherOptions(rawValue: .CHACHA20) | ||
|
||
/// All supported ciphers. | ||
static let all = CipherIdentifiers.allCases.map { ShadowsocksCipherOptions(rawValue: $0) } | ||
} | ||
|
||
enum CipherIdentifiers: String, CaseIterable, CustomStringConvertible, Codable { | ||
// Stream ciphers. | ||
case CFB_AES128 = "aes-128-cfb" | ||
case CFB1_AES128 = "aes-128-cfb1" | ||
case CFB8_AES128 = "aes-128-cfb8" | ||
case CFB128_AES128 = "aes-128-cfb128" | ||
case CFB_AES256 = "aes-256-cfb" | ||
case CFB1_AES256 = "aes-256-cfb1" | ||
case CFB8_AES256 = "aes-256-cfb8" | ||
case CFB128_AES256 = "aes-256-cfb128" | ||
case RC4 = "rc4" | ||
case RC4_MD5 = "rc4-md5" | ||
case CHACHA20 = "chacha20" | ||
case SALSA20 = "salsa20" | ||
case CHACHA20_IETF = "chacha20-ietf" | ||
|
||
// AEAD ciphers. | ||
case GCM_AES128 = "aes-128-gcm" | ||
case GCM_AES256 = "aes-256-gcm" | ||
case CHACHA20_IETF_POLY1305 = "chacha20-ietf-poly1305" | ||
case XCHACHA20_IETF_POLY1305 = "xchacha20-ietf-poly1305" | ||
case PMAC_SIV_AES128 = "aes-128-pmac-siv" | ||
case GPMAC_SIV_AES256 = "aes-256-pmac-siv" | ||
|
||
var description: String { | ||
rawValue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters