Documentation ¶
Index ¶
Constants ¶
View Source
const ( LEN_PREFIX = 1 LEN_VERSION = 1 // Should match len(PREFIX) LEN_SUFFIX = 1 // Should match len(SUFFIX) LEN_BODY = 2 LEN_LEN_IV = 1 LEN_IV = 12 LEN_TAG = 16 LEN_ACTUAL_HEADER = LEN_BODY + LEN_LEN_IV + LEN_IV LEN_HEADER = LEN_PREFIX + LEN_VERSION + LEN_ACTUAL_HEADER + LEN_SUFFIX /* 0 suffix */ )
View Source
const (
AES_GCM_TAG_LENGTH = 16
)
Variables ¶
View Source
var ( PREFIX = []byte{0} VERSION_0 = byte(0) VERSION_1 = byte(1) SUFFIX = []byte{0} )
View Source
var (
ErrNoData = errors.New("no data was passed")
)
Functions ¶
func DeriveEncryptionKey ¶
func DeriveEncryptionKey(sharedMeetingKey, secretNonce []byte, keyType AesKeyType) []byte
func RewriteAudioHack ¶
Types ¶
type AesGcmCrypto ¶
type AesGcmCrypto struct {
// contains filtered or unexported fields
}
func NewAesGcmCrypto ¶
func NewAesGcmCrypto(sharedMeetingKey, secretNonce []byte, keyType AesKeyType) (*AesGcmCrypto, error)
type AesKeyType ¶
type AesKeyType byte
const ( KEY_TYPE_VIDEO AesKeyType = 0x00 KEY_TYPE_AUDIO AesKeyType = 0x01 // TODO: assumption not tested KEY_TYPE_SCREENSHARE AesKeyType = 0x02 )
type RtpEncryptedPayload ¶
type RtpEncryptedPayload struct { Version uint8 LenCiphertext uint32 LenIV uint8 IV []byte Ciphertext []byte Tag []byte }
func NewRtpEncryptedPayload ¶
func NewRtpEncryptedPayload(version uint8, IV []byte, CiphertextWithTag []byte) *RtpEncryptedPayload
func (*RtpEncryptedPayload) Marshal ¶
func (encryptedPayload *RtpEncryptedPayload) Marshal() []byte
func (*RtpEncryptedPayload) Unmarshal ¶
func (encryptedPayload *RtpEncryptedPayload) Unmarshal(payload []byte) error
func (*RtpEncryptedPayload) UnmarshalHeader ¶
func (encryptedPayload *RtpEncryptedPayload) UnmarshalHeader(header []byte) error
Click to show internal directories.
Click to hide internal directories.