Skip to content
Snippets Groups Projects
Commit 10100920 authored by jakobsbode's avatar jakobsbode
Browse files

update Travellib

parent e7b132dd
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ CHECKOUT OPTIONS:
:commit: e6b4597d3bbff232e63f50942318f2b4d3523b1b
:git: https://github.com/MailCore/mailcore2.git
Travellib:
:commit: 9ce858d03a21e139b7bfa069d219942875aec8f1
:commit: 2675c5df3d209d97311aa9ad552427f99a27a6ae
:git: https://git.imp.fu-berlin.de/jakobsbode/travellib.git
SPEC CHECKSUMS:
......
......@@ -55,7 +55,7 @@ CHECKOUT OPTIONS:
:commit: e6b4597d3bbff232e63f50942318f2b4d3523b1b
:git: https://github.com/MailCore/mailcore2.git
Travellib:
:commit: 9ce858d03a21e139b7bfa069d219942875aec8f1
:commit: 2675c5df3d209d97311aa9ad552427f99a27a6ae
:git: https://git.imp.fu-berlin.de/jakobsbode/travellib.git
SPEC CHECKSUMS:
......
......@@ -232,7 +232,7 @@ public class Crypto {
/*
requires alphabet to have a maximal length of 256
*/
static func createRandom(characters: Int, alphabet: [String]) throws -> String {
public static func createRandom(characters: Int, alphabet: [String]) throws -> String {
guard alphabet.count <= 256 else {
throw TravelError.invalidAlphabet
}
......@@ -253,7 +253,7 @@ public class Crypto {
//bits should be less or equal to 64, more bits will not be considered at the moment
//alphabet should contian maximal 256 symbols at the moment
static func createRandom(bits: Int, alphabet: [String]) throws -> String {
public static func createRandom(bits: Int, alphabet: [String]) throws -> String {
guard alphabet.count <= 256 else {
throw TravelError.invalidAlphabet
}
......@@ -265,7 +265,7 @@ public class Crypto {
return result
}
static func convertToPassword(number: UInt64, alphabet: [String], bits: Int) throws -> String {
public static func convertToPassword(number: UInt64, alphabet: [String], bits: Int) throws -> String {
guard alphabet.count <= 256 else {
throw TravelError.invalidAlphabet
}
......@@ -285,7 +285,7 @@ public class Crypto {
return result
}
static func convertToNumber(password: String, alphabet: [String]) throws -> UInt64 {
public static func convertToNumber(password: String, alphabet: [String]) throws -> UInt64 {
var result: UInt64 = 0
var pw = password
for _ in 0 ..< pw.count {
......@@ -300,6 +300,7 @@ public class Crypto {
return result
}
//TODO: remove
func bitsNotZero(value: UInt64) -> [Int] {
var temp = value
var result: [Int] = []
......
......@@ -171,6 +171,16 @@ public class Traveler: Codable {
return keys
}
//returns the address that may be used to backup secretkeys while traveling
public func getTravelerAddress() -> String {
return travelerAddress
}
//returns the key that may be used to backup secretkeys while traveling
public func getTravelerKey() -> String {
return travelerKey
}
public func deletePasswordReference() {
pw1 = ""
pw2 = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment