jimmysong / pb-exercises Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
The use of random is not recommended for cryptographic or security purposes.
Warning The pseudo-random generators of this module should not be used for security purposes. For security or cryptographic uses, see the secrets module.
Reference: https://docs.python.org/3/library/random.html (Red Box warning)
If the project wants to use random for legacy reasons, it should atleast be mentioned that it is insecure. If this is mentioned elsewhere in the book, please close the issue.
Was getting this error in the pip install -r requirements.txt
step
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
^~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycrypto
Running setup.py clean for pycrypto
Failed to build pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
error: subprocess-exited-with-error
Turns out I was able to prepend the install command like this, which then made it work:
env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install -r requirements.txt
Здравствуйте, не знал куда написать, пишу сюда, по поводу выполнения упражнения 1 в главе 3, выдает ошибку PS C:\Users\banda> & C:/Users/banda/AppData/Local/Programs/ Python/Python39/python.exe c:/Users/banda/Desktop/PY3/main.py Возврат
(последний последний вызов):
Файл «c:\Users\banda\Desktop\PY3\main.py», строка 109, в
print(on_curve(Элемент поля(192, простое число), Элемент поля(105, простое число)))
Файл "c:\Users\banda\Desktop\PY3\main.py ", строка 108, в on_curve
return y 2 == x 3 + a*x +b
Ошибка типа: Неподдерживаемые типы операндов для *: «Элемент поля» и «Элемент поля».
Я вставил код, опубликованный на Github, ошибка сохраняется.
PS буду рад оказанной помощи
from ecc import FieldElement
prime = 223
a = FieldElement(0, prime)
b = FieldElement(7, prime)
def on_curve(x,y):
... return y 2 == x 3 + a*x + b
print(on_curve (FieldElement(192, простое), FieldElement(105, простое)))
True
print(on_curve(FieldElement(17, простое), FieldElement(56, простое)))
True
print(on_curve(FieldElement(200, простое), FieldElement( 119, штрих)))
Ложь
print(on_curve(FieldElement(1, штрих), FieldElement(193, штрих)))
True
print(on_curve(FieldElement(42, штрих), FieldElement(99, штрих)))
False
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.