mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
verificationhelper/qrcode: begin implementing flow
Signed-off-by: Sumner Evans <sumner@beeper.com>
This commit is contained in:
parent
f46d2d349a
commit
582ce5de49
5 changed files with 974 additions and 0 deletions
13
id/crypto.go
13
id/crypto.go
|
|
@ -7,6 +7,7 @@
|
|||
package id
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
|
@ -74,6 +75,12 @@ func (ed25519 Ed25519) String() string {
|
|||
return string(ed25519)
|
||||
}
|
||||
|
||||
func (ed25519 Ed25519) Bytes() []byte {
|
||||
val, _ := base64.RawStdEncoding.DecodeString(string(ed25519))
|
||||
// TODO handle errors
|
||||
return val
|
||||
}
|
||||
|
||||
func (ed25519 Ed25519) Fingerprint() string {
|
||||
spacedSigningKey := make([]byte, len(ed25519)+(len(ed25519)-1)/4)
|
||||
var ptr = 0
|
||||
|
|
@ -97,6 +104,12 @@ func (curve25519 Curve25519) String() string {
|
|||
return string(curve25519)
|
||||
}
|
||||
|
||||
func (curve25519 Curve25519) Bytes() []byte {
|
||||
val, _ := base64.RawStdEncoding.DecodeString(string(curve25519))
|
||||
// TODO handle errors
|
||||
return val
|
||||
}
|
||||
|
||||
// A DeviceID is an arbitrary string that references a specific device.
|
||||
type DeviceID string
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue