math

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 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 Factorize

func Factorize(pq *big.Int) (*big.Int, *big.Int)

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

type Random

type Random struct {
	// contains filtered or unexported fields
}

func (*Random) FastUint64

func (r *Random) FastUint64() uint64

Jump to

Keyboard shortcuts

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