math

package
v0.0.0-...-761494b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) 2024 RoseLoverX

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRSAencrypt

func DoRSAencrypt(block []byte, key *rsa.PublicKey) []byte

DoRSAencrypt encrypts exactly 1 message block of size 255 with the public key. Specific algorithm for mtproto, because the documentation does not indicate is this encryption working by OAEP spec or any else

func Fac

func Fac(pq *big.Int) (p, q *big.Int)

Fac splits a number into two primes, while p < q Part of diffie hellman's algorithm Uses Pollard's rho algorithm

func MakeGAB

func MakeGAB(g int32, g_a, dh_prime *big.Int) (b, g_b, g_ab *big.Int)

func SplitPQ

func SplitPQ(pq *big.Int) (p1, p2 *big.Int)

SplitPQ splits a number into two primes, while p1 < p2 Part of diffie hellman's algorithm, how it works - no idea

func Xor

func Xor(dst, src []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL