Skip to content

Commit

Permalink
added sound and indicaton on tau in ceremony, trusted setup, pairings…
Browse files Browse the repository at this point in the history
… and intro
  • Loading branch information
martawleklinska committed Jul 19, 2024
1 parent f3b81dc commit 6cf7ec7
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 26 deletions.
Binary file added data/sound/episode3/slide0-0.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide1-3.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide1-4.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide4-1.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide5-1.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide5-2.mp3
Binary file not shown.
Binary file modified data/sound/episode3/slide5-3.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion zkmarek/video/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
]

EPISODE3 = [
Intro(sound="data/sound/teaser2/slide0-0.mp3", background_sound="data/sound/episode3/background.mp3",),
Intro(sound="data/sound/episode3/slide0-0.mp3", background_sound="data/sound/episode3/background.mp3",),
Sponsored(),
Introduction(),
TitleSlide("Pairing", sound="data/sound/episode3/slide1-4.mp3", wait_time=3.5),
Expand Down
3 changes: 3 additions & 0 deletions zkmarek/video/mobjects/tex_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def __init__(self, values, width = 2):
cell = TexCell(value, width)
self.cells.append(cell)
self.add(cell)
self.arrange(RIGHT, buff=0)

def arrange_cells(self):
self.arrange(RIGHT, buff=0)

def animate_transform_matching_shapes(self, scene, values):
Expand Down
27 changes: 18 additions & 9 deletions zkmarek/video/slides/episode3/ceremony.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from manim import LEFT, DOWN, UP, RIGHT, MathTex, Tex, Text, Write, Line, ImageMobject, FadeIn, FadeOut, Indicate

from zkmarek.video.constant import PRIMARY_COLOR, PRIMARY_FONT, SECONDARY_COLOR
from zkmarek.video.constant import PRIMARY_COLOR, PRIMARY_FONT, SECONDARY_COLOR, HIGHLIGHT_COLOR
from zkmarek.video.mobjects.tex_array import TexArray
from zkmarek.video.slides.common.slide_base import SlideBase

PARTICIPANT_1 = [
r"{{\tau_0^1 G_1}}",
r"\tau_0^2 G_1",
r"{{\tau_0^1}} {{G_1}}",
r"{{\tau_0^2}} {{G_1}}",
r". . .",
r"\tau_0^n G_1"
r"{{\tau_0^n}} {{G_1}}"
]

PARTICIPANT_2 = [
Expand Down Expand Up @@ -81,15 +81,24 @@ def animate_in(self, scene):

self.new_subsection(scene, "first participant", "data/sound/episode3/slide5-1.mp3")
scene.play(FadeIn(self.person), Write(self.tau_0), FadeOut(self.person_tau0, self.person_tau1, self.person_tau2, self.group))
scene.play(Write(self.vector_0))
scene.wait(3.7)
scene.play(Indicate(self.tau_0, color = PRIMARY_COLOR), run_time=0.8)
scene.play(Write(self.vector_0.cells[0]))

self.new_subsection(scene, "beginning of ceremony", "data/sound/episode3/slide5-2.mp3")
scene.play(Write(self.vector_0[1:]))
scene.play(Indicate(self.vector_0.cells[0][1][0], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_0.cells[1][1][0], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_0.cells[3][1][0], color = HIGHLIGHT_COLOR))

self.new_subsection(scene, "next participant", "data/sound/episode3/slide5-2.mp3")
scene.play(Write(self.tau_1), FadeIn(self.person2))
scene.play(Write(self.vector_1))
scene.wait(3.5)
scene.play(Indicate(self.tau_0, color = PRIMARY_COLOR))
scene.play(Indicate(self.tau_1, color = PRIMARY_COLOR))
self.new_subsection(scene, "next participant", "data/sound/episode3/slide5-3.mp3")
scene.play(Indicate(self.vector_0.cells[0][1][0], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_0.cells[1][1][0], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_0.cells[3][1][0], color = HIGHLIGHT_COLOR))

self.new_subsection(scene, "last participant", "data/sound/episode3/slide5-3.mp3")
scene.play(Write(self.three_dot))
scene.play(Write(self.tau_k))
scene.play(Write(self.vector_k))
Expand Down
4 changes: 2 additions & 2 deletions zkmarek/video/slides/episode3/pairing.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def animate_in(self, scene):
scene.wait(0.5)
scene.play(Indicate(self.bilinearity[9], color = HIGHLIGHT_COLOR))
scene.wait(4)
scene.play(TransformMatchingShapes(self.bilinearity, self.bilinearity2))
scene.play(FadeOut(self.bilinearity), FadeIn(self.bilinearity2))

scene.wait(4)
scene.play(TransformMatchingShapes(self.bilinearity2, self.bilinearity3))
scene.play(FadeOut(self.bilinearity2), FadeIn(self.bilinearity3))
scene.wait(1)

self.new_subsection(scene, "multiplying", "data/sound/episode3/slide2-3.mp3")
Expand Down
42 changes: 28 additions & 14 deletions zkmarek/video/slides/episode3/trusted_setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from manim import LEFT, RIGHT, DOWN, UP, MathTex, Tex, Text, Write, Line, ImageMobject, FadeIn, FadeOut, Indicate
from manim import LEFT, RIGHT, DOWN, UP, MathTex, Tex, Text, Write, Line, ImageMobject, FadeIn, FadeOut, Indicate, TransformMatchingShapes

from zkmarek.video.constant import PRIMARY_COLOR, PRIMARY_FONT, SECONDARY_COLOR, HIGHLIGHT_COLOR
from zkmarek.video.mobjects.tex_array import TexArray
Expand Down Expand Up @@ -26,7 +26,7 @@
]

SETUP_G2_1 = [
r"\tau^1 G_2",
r"{{\tau^1}} {{G_2}}",
r"\tau^2 G_2",
r"...",
r"\tau^n G_2"
Expand Down Expand Up @@ -54,11 +54,15 @@ def construct(self):
self.tau = Tex(r"$\tau$ - random secret shared number in $\mathbb{F}_p$", color=SECONDARY_COLOR)

self.vector_g1 = TexArray(SETUP_G1_1)
self.new_vector_g1 = TexArray(SETUP_G1_2)
self.vector_g2 = TexArray(SETUP_G2_1)
self.new_vector_g2 = TexArray(SETUP_G2_1)
self.title_label.to_edge(UP)
self.tau.next_to(self.title_label, DOWN, buff=0.8)
self.vector_g1.next_to(self.tau, DOWN, buff=0.6)
self.new_vector_g1.next_to(self.tau, DOWN, buff=0.6)
self.vector_g2.next_to(self.vector_g1, DOWN)
self.new_vector_g2.next_to(self.vector_g1, DOWN)
self.strike = Line(
start=self.tau.get_critical_point(LEFT),
end=self.tau.get_critical_point(RIGHT), color=SECONDARY_COLOR)
Expand Down Expand Up @@ -90,24 +94,34 @@ def animate_in(self, scene):
scene.play(FadeIn(self.person4))
scene.play(FadeIn(self.tau_number))
scene.play(FadeIn(self.question4, self.question1, self.question3, self.question2))

scene.wait(3.5)

self.new_subsection(scene, "multiplying by G1", "data/sound/episode3/slide4-1.mp3")
scene.play(FadeOut(self.question4, self.question1, self.question3, self.question2, self.person1, self.person2, self.person3, self.person4, self.tau_number),Write(self.vector_g1))
self.vector_g1.animate_transform_matching_shapes(scene, SETUP_G1_2)
scene.wait(2.5)
scene.play(Indicate(self.vector_g1[0][1], color = HIGHLIGHT_COLOR))
scene.wait(2.5)
scene.play(Indicate(self.vector_g1[0][1], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_g1[1][1], color = HIGHLIGHT_COLOR))
scene.play(Indicate(self.vector_g1[3][1], color = HIGHLIGHT_COLOR))
scene.play(FadeOut(self.question4, self.question1, self.question3, self.question2, self.person1, self.person2, self.person3, self.person4, self.tau_number))
scene.play(Write(self.vector_g1.cells[0]))
scene.wait(6)

scene.play(Indicate(self.vector_g1.cells[0][1][2], color = HIGHLIGHT_COLOR)) # indicate on G1
scene.wait(3)
scene.play(Indicate(self.vector_g1.cells[0][1][0], color = HIGHLIGHT_COLOR)) # indicate on tau

for i in range(1, len(self.vector_g1.cells)):
self.vector_g1.cells[i].next_to(self.vector_g1.cells[i-1], RIGHT, buff=0)
scene.play(FadeIn(self.vector_g1.cells[i]), run_time=0.5)
scene.play(Indicate(self.vector_g1.cells[i][1][0], color = HIGHLIGHT_COLOR))
scene.wait(0.4)

for old_cell, new_cell in zip(self.vector_g1.cells, self.new_vector_g1.cells):
scene.play(TransformMatchingShapes(old_cell[1], new_cell[1]), run_time=0.4)

self.new_subsection(scene, "multiplying by G2", "data/sound/episode3/slide4-2.mp3")
scene.play(Write(self.vector_g2))
scene.wait(2)
scene.play(Indicate(self.vector_g2[0][1], color = HIGHLIGHT_COLOR), Indicate(self.vector_g1[0][1], color = HIGHLIGHT_COLOR))
self.vector_g1.animate_transform_matching_shapes(scene, SETUP_G1_3)
scene.play(Indicate(self.new_vector_g1.cells[0][1][2], color = HIGHLIGHT_COLOR), Indicate(self.vector_g2.cells[0][1][2], color = HIGHLIGHT_COLOR))

self.new_vector_g1.animate_transform_matching_shapes(scene, SETUP_G1_3)

self.new_subsection(scene, "there are ec points", "data/sound/episode3/slide4-3.mp3")
self.vector_g2.animate_transform_matching_shapes(scene, SETUP_G2_2)
scene.wait(3.5)


0 comments on commit 6cf7ec7

Please sign in to comment.