Update comments.

pull/1/head
Matthew Chen 7 years ago
parent 2d3314751b
commit bf2edf2486

@ -48,7 +48,7 @@ public class DeviceNames: NSObject {
// cipher_text = AES-CTR(key=cipher_key, input=plaintext, counter=0) // cipher_text = AES-CTR(key=cipher_key, input=plaintext, counter=0)
// //
// TODO: Is this IV right? // An all-zeros IV corresponds to an AES CTR counter of zero.
let ciphertextIV = Data(count: Int(kAES256CTR_IVLength)) let ciphertextIV = Data(count: Int(kAES256CTR_IVLength))
guard let ciphertextKey = OWSAES256Key(data: cipherKey) else { guard let ciphertextKey = OWSAES256Key(data: cipherKey) else {
owsFailDebug("Invalid cipher key.") owsFailDebug("Invalid cipher key.")
@ -64,7 +64,7 @@ public class DeviceNames: NSObject {
ciphertext: ciphertext.ciphertext) ciphertext: ciphertext.ciphertext)
let protoData = try protoBuilder.buildSerializedData() let protoData = try protoBuilder.buildSerializedData()
// TODO: This uses Data's foundation method rather than the NSData's SSK method. // NOTE: This uses Data's foundation method rather than the NSData's SSK method.
let protoDataBase64 = protoData.base64EncodedData() let protoDataBase64 = protoData.base64EncodedData()
return protoDataBase64 return protoDataBase64
@ -168,7 +168,7 @@ public class DeviceNames: NSObject {
// plaintext = AES-CTR(key=cipher_key, input=ciphertext, counter=0) // plaintext = AES-CTR(key=cipher_key, input=ciphertext, counter=0)
// //
// TODO: Is this IV right? // An all-zeros IV corresponds to an AES CTR counter of zero.
let ciphertextIV = Data(count: Int(kAES256CTR_IVLength)) let ciphertextIV = Data(count: Int(kAES256CTR_IVLength))
guard let ciphertextKey = OWSAES256Key(data: cipherKey) else { guard let ciphertextKey = OWSAES256Key(data: cipherKey) else {
owsFailDebug("Invalid cipher key.") owsFailDebug("Invalid cipher key.")

Loading…
Cancel
Save